ruby - 如何从 net.ssh.authentication Ruby 获取更详细的错误消息
问题描述
我正在尝试查看来自 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”响应。
请帮忙
解决方案
推荐阅读
- python - ImportError:无法从“numpy.core”(未知位置)导入名称“array”
- javascript - 克隆每个元素追加下一个元素
- r - 在不同的数据组上绘制不同的自定义 stat_function
- javascript - 下载Excel后的Javascript回调函数
- javascript - Javascript - 任何跳过未定义属性的休息运算符?
- python - 无法在 PyCharm 中通过 networkx 显示图形
- node.js - 使用 Qunit 验证引导日期选择器
- tensorflow - 图像张量的形状是否会影响结果输出?
- ios - 为什么 iOS 12 中的日期序数计算发生了变化?
- sql - 尝试创建表时出现无效标识符错误