in reply to Re^3: execute multiple commands over ssh (without module)
in thread execute multiple commands over ssh (without module)
Net::OpenSSH is a very nice module. but on the solaris server isn't installed OpenSSH. thats the problem.
so now i have tested the following but it does not work. have anybody an idea?
#!/usr/bin/perl -w use strict; use IPC::Open2; open2(*SSH_OUT, *SSH_IN, 'ssh -T localhost'); print SSH_IN "df -h"; my $df = <SSH_OUT>; print SSH_IN "du -sh"; my $du = <SSH_OUT>; print SSH_IN "exit"; print $df; print $du;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: execute multiple commands over ssh (without module)
by salva (Canon) on Feb 06, 2012 at 21:28 UTC |