From: Jonathan Hudson Date: 2008-04-18T04:25:05+09:00 Subject: Re: Windows, Net::SSH: how do I send a password to sudo? On Thu, 17 Apr 2008 14:16:26 -0500 James Dinkel wrote: > 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. Occurred to me that there is a chance of the password being visible via ps or such. -jh