SSH Server的配置方法:
一、設置jenkins服務器的密碼,設置完顯示如下

二、設置其他ssh連接服務器的信息:
Name:取一個自己容易認的名稱,如**項目測試機
Hostname:指連接機器的IP或域名
Username:連接機器的用戶,必須使用一個有權限的用戶,如果覺得root太大,可在服務器另建一個用戶,專門用來做jenkins訪問使用的
Remote Directory:遠程連接上去默認訪問的路徑,必須存在,並且有權限
勾選下方的權限選項,並設置一個密碼password
此密碼為登錄用戶名相對應的密碼,並且可用,否則連接不了。

三、連接測試
以上配置完畢后,點擊Test Configureation,出現如下提示:
Failed to connect or change directory
jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168.10.130]. Message [java.net.ConnectException: Connection refused (Connection refused)]]
解決方法:服務沒啟,直接到相對應的這台機器,執行啟動命令
service sshd start
如果出現以下提示:

|
Failed to connect or change directory
jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168.10.130]. Message [Auth fail]] |
原因:密碼設置錯誤了,點擊Change password修改為正確的密碼即可。
