Ruby SSH gem非交互式无效选项?
我有如下Ruby代码:Ruby SSH gem非交互式无效选项?,ruby,ssh,Ruby,Ssh,我有如下Ruby代码: def make_ssh user, pass begin Net::SSH.start(@host, user, :password => pass, :non_interactive => true) do |session| @ssh = session puts @ssh end rescue Exception => e puts e end end 在Net::SSH库中,:non
def make_ssh user, pass
begin
Net::SSH.start(@host, user, :password => pass, :non_interactive => true) do |session|
@ssh = session
puts @ssh
end
rescue Exception => e
puts e
end
end
在Net::SSH库中,:non_interactive
命令应该否定密码提示(我假设使用key/value:password=>pass
进行身份验证),但每次尝试运行代码时,都会出现“invalid option”错误
我已经尝试过使用ssh块和不使用ssh块,以及
Net::SSH.start(@host, user, {:password => pass, :non_interactive => true})
但似乎什么都不管用。我做错了什么?我得到了和你一样的厄洛尔。此选项添加在net ssh 2.10.0中。您可能正在使用较低版本