From: James Dinkel Date: 2008-04-18T04:16:26+09:00 Subject: Re: Windows, Net::SSH: how do I send a password to sudo? Jonathan Hudson wrote: > On Thu, 17 Apr 2008 12:48:03 -0500 > James Dinkel wrote: > >> end >> course doesn't run the command. Any ideas on how I could get the >> password prompt to the user? > > a. Add user / command to /etc/sudoers, so a pasword is not required; > > b. Ask for the password in your script, and then > channel.exec "echo #{password} | sudo -S echo \"r00ted\"". > > In the latter case, don't blame me when you later suffer from a severe > case of unexpected local user privilege escalation. > > -jh ah yeah, I thought of the echoing in from stdin after I posted the question. I don't see what you mean by "suffer from a severe case of unexpected local user privilege escalation" though. -- Posted via http://www.ruby-forum.com/.