From: "Ivan C." Date: 2011-10-05T17:45:47+09:00 Subject: How to use 'net/ssh' to sudo su - Hi, i am trying to ssh to a server and execute some commands. To do that, i need to become a root user and somehow it does not work with below. ssh = Net::SSH.start("host", "user", :password =>"xxxx") ssh.exec!('sudo su -') ssh.exec!('xxxx') txt = ssh.exec!('ls -al') puts txt By executing ls -al as a test, the returns are not based on the root permission. My guess is the sudo su - does not actually works. Please advise -- Posted via http://www.ruby-forum.com/.