我正在尝试查看来自SSH服务器的详细错误消息
我有什么:
require 'rubygems'
require 'net/ssh'
require 'sshkey'
k = SSHKey.generate(
type: "RSA",
bits: 2048
)
begin
Net::SSH.start("x.x.x.x","username", :keys=>[k.public_key], :verbose => Logger::DEBUG, :auth_methods => ['publickey']) do |ssh|
end
rescue SocketError
puts "Host name cannot be resolved."
strBypass = true
rescue Net::SSH::AuthenticationFailed
puts " Authentication failure"
end
我特别希望从ssh服务器获得“ SSH2_MSG_USERAUTH_FAILURE”响应。
请帮助