0
HY 我寫這篇文章的代碼在我的劇本連接服務器:: SSH
def connect_sql
Net::SSH.start(@host, @user, :port=>22, :verbose => :debug) do |ssh|
puts ssh.exec!("./root/scripts/MysqlCleanInstance.sh #{@uid}")
end
末
的probleme是兩個服務器之間etablish一個conenction我們使用DNS .The DNS信息,在/etc/resolv.conf中。
我不知道爲什麼,當我嘗試連接到另一臺服務器,我得到這個錯誤:
, [2014-01-08T17:55:34.905977 #28115] DEBUG -- tcpsocket[3f87c7e6b534]: received packet nr 5 type 51 len 44
D, [2014-01-08T17:55:34.906129 #28115] DEBUG -- net.ssh.authentication.session[3f87c7e5b2b0]: allowed methods: publickey,password
D, [2014-01-08T17:55:34.906309 #28115] DEBUG -- net.ssh.authentication.methods.keyboard_interactive[3f87c7e58948]: keyboard-interactive failed
E, [2014-01-08T17:55:34.906487 #28115] ERROR -- net.ssh.authentication.session[3f87c7e5b2b0]: all authorization methods failed (tried none, publickey, hostbased, password, keyboard-interactive)
/var/lib/gems/1.8/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start': Net::SSH::AuthenticationFailed (Net::SSH::AuthenticationFailed)
from clean_instance.rb:87:in `connect_sql'
你測試平原通過ssh作爲進入遠程主機:'SSH用戶@ host'? –