macOS scp上传文件到Linux服务器免密码

默认执行scp root@a.b.c.d localFile remoteFile是需要输入密码的,但是很多场景是需要免密码输入的,比如Jenkins打包,打完包要上传到服务器,这个时候就不能用密码来连接Linux服务器 …

方法其实很简单,这应该就是个对称加密,只要把本地的.ssh证书发送到Linux服务器,那么以后就可以免密连接了 …

➜  ~ ssh-copy-id root@110.42.253.75
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/net.cctv3.i/.ssh/id_rsa.pub"
The authenticity of host '110.42.253.75 (110.42.253.75)' can't be established.
ED25519 key fingerprint is SHA256:H8LoxT6k8djf0mLK5EzTwa6/xbZEoB+c2vRKienaQGE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

这个时候,我们来到Linux服务器的authorized_keys文件,看到本地的证书已经加进去了

Jenkins再次上传发现已经稳稳的拿捏了

macOS scp上传文件到Linux服务器免密码

https://www.cctv3.net/static/20240226/linux-scp-without-password.html

作者

江北饮马、江南折花

发布于

2024-02-26

更新于

2024-02-28

许可协议

评论