I need to run a command in remote host, I tried the following but I got error. Kindly solve this,
#!/usr/bin/env ruby
require 'rubygems'
require 'net/ssh'
HOST = '192.168.1.113'
USER = 'username'
PASS = 'password'
Net::SSH.start( HOST, USER, :password => PASS ) do|ssh|
ssh.exec('ls')
end
Error:
/usr/lib/ruby/1.8/net/ssh/session.rb:132: in `initialize': rmts (Net::SSH::Auth enticationFaile d)
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 run_command.rb: 9
#!/usr/bin/env ruby
require 'rubygems'
require 'net/ssh'
HOST = '192.168.1.113'
USER = 'username'
PASS = 'password'
Net::SSH.start( HOST, USER, :password => PASS ) do|ssh|
ssh.exec('ls')
end
Error:
/usr/lib/ruby/1.8/net/ssh/session.rb:132: in `initialize': rmts (Net::SSH::Auth enticationFaile d)
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 run_command.rb: 9
Comment