![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^3: using Net::SSH::Perl: problem with Math::Pariby sgt (Deacon) |
on May 10, 2008 at 23:34 UTC ( #685915=note: print w/replies, xml ) | Need Help?? |
Well, first you are aware that 'ssh host command' runs command on host, aren't you. If certificates have been set up you will not be prompted for a passwd. So this would be suitable for cron. Note that command will be executed by the system shell, so you can actually use perl on the local side to build a (shell) script. You could also scp the command (or script) and then execute it remotely. Now if the remote sshd asks for a passwd, you'll need to pass the passwd using expect for example (Perl module or command), or tweak pssh the client that comes with Net::Ssh::Perl so that it can read the passwd from a file o env_var o whatever. Finally there are security implications doing the latter. As an example I'll show you a remote uname -a using expect and ssh: cheers --stephan
In Section
Seekers of Perl Wisdom
|
|