Hii all ,
          Am using Net/TELNET to connect to remote host trying to run su
command in order to get root privilage this is how i doing


require 'net/telnet'
   localhost = Net::Telnet::new("Host" => "192.147.217.27",
                               "Timeout" => 50,
                               "Prompt" => /[$%#>] \z/n)
   localhost.login("dvsdkrp", "dvsdkvrp") { |c| print c }
   localhost.cmd("cd /home/dvsdkrp/workdir/smruti") { |c| print c }
   localhost.cmd("su") { |c| print c }
   localhost.puts("passwd"){ |c| print c }

  But am getting this error

Password: C:/Ruby/lib/ruby/1.8/net/telnet.rb:552:in `waitfor': timed out
while waiting for more data (Timeout::Error)
        from C:/Ruby/lib/ruby/1.8/net/telnet.rb:679:in `cmd'
        from tel.rb:7

What should i do??

-- 
Posted via http://www.ruby-forum.com/.