in reply to Re^8: Problem using Net::OpenSSH->capture to su to another user
in thread Problem using Net::OpenSSH->capture to su to another user
Regarding the Perl part, sudo does not expect the subcommand and its arguments passed combined into a single argument. Try as follows:
$ssh->capture({ tty => 1, stdin_data => "$password\n" }, 'sudo', '-Sk', '-p', '', '--', 'su', '-lc', 'ls', imail' +);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Problem using Net::OpenSSH->capture to su to another user
by tim.culhane (Initiate) on Jun 05, 2014 at 10:25 UTC | |
by salva (Canon) on Jun 05, 2014 at 10:30 UTC | |
by tim.culhane (Initiate) on Jun 05, 2014 at 14:06 UTC | |
by salva (Canon) on Jun 05, 2014 at 14:26 UTC | |
by tim.culhane (Initiate) on Jun 06, 2014 at 08:22 UTC |