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'? –