develooper Front page | perl.beginners | Postings from January 2012

Re: Net::Openssh and sudo?

Thread Previous | Thread Next
From:
Salvador Fandino
Date:
January 30, 2012 02:45
Subject:
Re: Net::Openssh and sudo?
Message ID:
4F252DF4.3060000@yahoo.com
On 01/29/2012 07:53 AM, Rajeev Prasad wrote:
> Hi Salva,
>
> thx, but the installed sudo version does not have -S option. so i am not sure how will i then pass the password....

Yes, with older versions of sudo, using Expect is probably the best way.

That may also work:

   my $output = $ssh->capture({tty => 1,
                               stdin_data => "$pass1\n"},
                              "/usr/local/bin/sudo",
                              "-k", $cmd, @cmd_args);


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About