Thanks Brian,,
"Net::SSH::Telnet" is has an advantage which it's keeping the session 
open until finish all commands not like "Net::SSH" which is create a 
session for each command/communication.

However, it doenst solve my issue

------------------------------------------------------------
require 'net/ssh/telnet'

  host = "127.0.0.1"
  port = 15000    # SSH port
  user = 'userName'  # username
  pass = "password"  # password


s = Net::SSH::Telnet.new("Host" => host, "Username" => user, "Password" 
=> pass)

  puts s.cmd("pwd")
  puts s.cmd "sudo passwd userName"
------------------------------------------------------------

that's my code :(

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