From: "wbsurfver@..." Date: 2008-02-07T23:24:56+09:00 Subject: using net::ssh shell to sudo to another user and execute commands The following program does not get past the part where sudo asks for a password. Any ideas ? This is run from windows onto a linux box, so I can't use a local ssh command. it outputs connected cd Net::SSH.start(host, :port => 22, :username => usr, :password => pwd) do |session| shell = session.shell.sync puts "connected" shell.cd '/somedir' puts "cd" shell.send_command 'sudo su otheruser', pwd puts 'sudo' shell.cp 'file_6.js tt6.js' puts "cp" shell.exit puts "exit" end