Hi List,
I’ve a big problema using the last version net-ssh on my Ubuntu (i386)
system.
My goal is execute a command on a remote system. I tried many things
including the manual examples:
- using exec
require ‘net/ssh’
Net::SSH.start(‘192.168.1.10’,‘test’,‘test’) do |ssh|
result = ssh.exec!(“id”)
puts result
end
/usr/lib/ruby/1.8/net/ssh/session.rb:199:in method_missing': private method
exec’ called for #Net::SSH::Session:0xb7c7a404 (NoMethodError)
from test.rb:6
from /usr/lib/ruby/1.8/net/ssh/session.rb:138:in initialize' from /usr/lib/ruby/1.8/net/ssh.rb:47:in
new’
from /usr/lib/ruby/1.8/net/ssh.rb:47:in `start’
from test.rb:5
- using exec into a channel
require ‘net/ssh’
Net::SSH.start(‘192.168.1.10’,‘test’,‘test’,:paranoid => false,:host_key
=> “ssh-rsa”,:encryption => “blowfish-cbc”) do |ssh|
ssh.open_channel do |channel|
channel.exec "id" do |ch, stream, data|
if stream == :stderr
puts "ERROR: #{data}"
else
puts data
end
end
channel.close
end
ssh.loop
end
No output…
What’s the problem? Any tips?
Thank you
Al