1. 程式人生 > >jenkins 中使用 rsync時需註意的

jenkins 中使用 rsync時需註意的

failed root ESS sender expect jenkins connect end syn

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時需註意的