码迷,mamicode.com
首页 > 其他好文 > 详细

jenkins 中使用 rsync时需注意的

时间:2019-01-17 11:40:36      阅读:381      评论:0      收藏:0      [点我收藏+]

标签:跳过   connect   cti   received   ssi   切换   been   fail   服务器   

1.jenkins 中使用 rsync 命令 是出现一些错误输出
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
和其他
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
在 /etc/passwd中 修改 jenkins 为 /bin/bash
jenkins:x:993:992:Jenkins Automation Server:/var/lib/jenkins:/bin/bash

2.在 jenkins 服务器切换到 jenkins账户 su - jenkins

创建密钥

ssh-keygen

Your identification has been saved in /var/lib/jenkins/.ssh/id_rsa.
Your public key has been saved in /var/lib/jenkins/.ssh/id_rsa.pub.

将公钥内容 id_rsa.pub 拷贝到客户端 /root/.ssh/authorized_keys 文件内

执行输出 结果为 success

3.远程执行ssh时增加‘StrictHostKeyChecking no‘ 跳过检查

ssh -p60022 -o ‘StrictHostKeyChecking no‘

jenkins 中使用 rsync时需注意的

标签:跳过   connect   cti   received   ssi   切换   been   fail   服务器   

原文地址:http://blog.51cto.com/28917/2343681

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!