jenkins遠程連接linux配置測試



由於配置原因造成一下錯誤
錯誤: jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [131]. Message [Auth fail]

配置方法:

1、生成密鑰
我的jenkins服務安裝在了linux下的jenkins用戶下
[jenkins@jenkins ~]$ ssh-keygen  
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jenkins/.ssh/id_rsa): //密鑰生成路徑,直接默認回車即可
Created directory '/home/jenkins/.ssh'.
Enter passphrase (empty for no passphrase): //默認回車
Enter same passphrase again: //默認回車
Your identification has been saved in /home/jenkins/.ssh/id_rsa.
Your public key has been saved in /home/jenkins/.ssh/id_rsa.pub.
The key fingerprint is:
c0:3d:31:ee:81:b6:5d:5f:d7:83:96:a3:92:85:e0:ab jenkins@jenkins
2、進入到目錄進行查看
[jenkins@jenkins ~]$ cd .ssh/
[jenkins@jenkins .ssh]$ ll
total 8
-rw-------. 1 jenkins jenkins 1671 Jul 17 23:23 id_rsa
-rw-r--r--. 1 jenkins jenkins  397 Jul 17 23:23 id_rsa.pub
3、將公鑰拷貝到authorized_keys文件
[jenkins@jenkins .ssh]$ cat id_rsa.pub >> authorized_keys    
4、將生成的authorized_keys拷貝到要連接的linux機器上的對應用戶下的.ssh文件夾下
[jenkins@jenkins .ssh]$ scp authorized_keys wqq@192.168.0.91:/home/wqq/.ssh
The authenticity of host '192.168.0.91 (192.168.0.91)' can't be established.
RSA key fingerprint is ff:dc:00:df:2c:40:70:63:95:ad:53:85:b7:8a:15:06.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.91' (RSA) to the list of known hosts.
reverse mapping checking getaddrinfo for bogon [192.168.0.91] failed - POSSIBLE BREAK-IN ATTEMPT!
wqq@192.168.0.91's password:
authorized_keys                                                                 100%  397     0.4KB/s   00:00  
5、配置SSH Server 左上角的jenkins-->系統管理-->系統設置

完成填寫之后點擊右下角的Test Configuration按鈕測試即可

 





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM