簡體   English   中英

將Mac Hudson從屬連接到Linux主服務器時,SSH密鑰身份驗證失敗

[英]SSH Key authentication failing when connecting Mac Hudson slave to Linux master

好吧,所以我讓Hudson(v1.393)在Ubuntu VM中運行,一切正常。 但是我正在嘗試將一個Mac奴隸添加到Ubuntu主服務器中,我遇到了一些問題。

我已經設置了SSH密鑰,因此從命令行,Ubuntu VM可以使用密鑰ssh到Mac上的一個名為hudson的用戶。

在Hudson slave配置中,我選擇了“通過SSH在Unix機器上啟動從屬代理”並輸入了主機IP,從屬用戶的用戶名以及我的私鑰文件在主服務器上的位置(已添加到主服務器)奴隸上的授權密鑰文件)。

但是,主站無法連接到從站。 查看日志(下面),它正在嘗試使用密碼進行身份驗證。

這是基於密鑰的SSH嘗試失敗的后退嗎?
Hudson是否只嘗試使用密碼進行身份驗證,我需要更改其他內容以使其使用配置中定義的密鑰文件?
是不是可以通過mac上的ssh啟動slave代理? (我知道這種類型的奴隸啟動方法明確表示Unix的名稱,但我正在考慮(閱讀:希望)它也適用於OS X)

日志

[01/14/11 10:38:07] [SSH] Opening SSH connection to 10.0.1.188:22.
[01/14/11 10:38:07] [SSH] Authenticating as hudson/******.
java.io.IOException: Password authentication failed.
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:319)
at com.trilead.ssh2.Connection.authenticateWithPassword(Connection.java:314)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:565)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:179)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.IOException: Authentication method password not supported by the server at this stage.
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:289)
... 9 more
[01/14/11 10:38:07] [SSH] Connection closed.

如果有人設法征服過這種類型的設置,或者有任何提示或想法,我將非常感激! 謝謝

我最近遇到了同樣的問題,嘗試使用SSH在Mac OS X 10.6機器上啟動代理。

要使密碼驗證工作,您需要在客戶端節點上編輯/ etc / sshd_config,設置PasswordAuthentication yes

在Hudson儀表板中,使節點脫機,確保配置具有有效的用戶名和密碼,然后啟動代理。 還要確保遠程FS根目錄由您正在連接的構建用戶擁有。

對於無密碼的ssh身份驗證,首先要檢查Hudson主服務器正在運行的用戶。 讓我們假設這是tomcat55 生成公鑰/私鑰SSH密鑰對(使用空密碼),然后驗證Hudson用戶是否可以連接。

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/tomcat55/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/tomcat55/.ssh/id_rsa.
Your public key has been saved in /home/tomcat55/.ssh/id_rsa.pub.

$ # authorize the hudson master on the hudson node
$ scp /home/tomcat55/.ssh/id_rsa.pub hudson@macnode:~/.ssh/authorized_keys
$ # test the connection
$ ssh -i /home/tomcat55/.ssh/id_rsa hudson@macnode

在Hudson mac節點上,/ etc / sshd_config需要允許無密碼訪問。

Protocol 2
PubkeyAuthentication yes

在節點配置中清除密碼字段,並設置私鑰字段(在此示例中為/home/tomcat55/.ssh/id_rsa)。 您現在應該能夠啟動代理:

[01/19/11 22:38:44] [SSH] Opening SSH connection to macnode:22.
[01/19/11 22:38:44] [SSH] Authenticating as hudson with /home/tomcat55/.ssh/id_rsa.
[01/19/11 22:38:45] [SSH] Authentication successful.

檢查Ubuntu機器上的/var/log/auth.log文件。 我打賭你需要chmod 700 hudson用戶的.ssh目錄。

我認為第一個答案(選擇的答案)是一個很棒的答案,但我確實找到了一個不是唯一解決方案的案例。

在我的情況下,我有一個Mac OS奴隸正在工作,然后我拿下那台Mac,並提出了一個新的。 我想我可以調整現有節點配置的設置,將其指向新的Mac。 它沒有用,我在整個消息線程中描述了所有相同的錯誤和問題。

然后我進入並刪除了節點並使用完全相同的設置重新創建它並且它工作。 懷疑 SSH密鑰指紋已更改,通過刪除節點並重新創建它,我能夠使其正常工作。 無論是什么,導致它失敗的關鍵組件都不是配置選項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM