Arlen Cuss
4/19/2008 4:19:00 AM
[Note: parts of this message were removed to make it a legal post.]
Hi,
On Sat, Apr 19, 2008 at 2:48 AM, James Dinkel <jdinkel@gmail.com> wrote:
> I WAS just trying to pass on the password to sudo being run over
> Net::SSH on a remote linux server. I eventually gave up on that and set
> sudo to run with no password, only to find out that does not work
> either! For some reason there is a problem running sudo commands over
> Net::SSH.
>
Strange. It works for me:
>> Net::SSH.start 'localhost', :username => 'test', :password => '...' do
|session|
?> session.open_channel do |channel|
?> channel.on_data do |ch, data|
?> puts data
>> end
>> channel.exec 'sudo touch rootfile'
>> end
>> session.loop
>> end; nil
=> nil
>>
celtic@sohma:~$ ls -l ~test
total 0
-rw-r--r-- 1 test test 0 2008-04-19 14:16 a
lrwxrwxrwx 1 test test 26 2008-04-19 14:14 Examples ->
/usr/share/example-content/
-rw-r--r-- 1 root root 0 2008-04-19 14:17 rootfile
celtic@sohma:~$
Are you sure the user can always sudo without password?
Arlen