scp 使用秘钥远程发布

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_40603236/article/details/79359308

root@localhost workspace]# scp -r /workspace/jenkins_workspace/workspace/api.pp.com.tar.gz  [email protected]:/workspace/
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
lost connection

解决方法: 修改目标主机的sshd_config文件

vim /etc/ssh/sshd_config

把 PasswordAuthentication no中的“no”改为yes

重启ssh服务: service sshd restart

 scp -i 秘钥地址  目标文件  root@远程主机:/目录地址/

猜你喜欢

转载自blog.csdn.net/weixin_40603236/article/details/79359308
scp