comanche008 has asked for the wisdom of the Perl Monks concerning the following question:
Many thanks.my ($def_in, $def_out); open $def_in, '<', '/dev/null' or die "unable to open /dev/null"; open $def_out, '>', '/dev/null' or die "unable to open /dev/null"; my $host = '192.168.0.1'; my %opts = ( user => 'root', batch_mode => 1, key_path => '~/.ssh/id_rsa', ssh_cmd => '/usr/bin/ssh', default_stdin_fh => $def_in, default_stdout_fh => $def_out, kill_ssh_on_timeout => 1, timeout => 5 ); my $ssh = Net::OpenSSH->new( $host, %opts ); $ssh->error and die "Unable to connect to server. ".$ssh->error; my $text = $ssh->capture({stderr_to_stdout => 1, timeout=>1, stdin +_data => "cat /myfile.txt;exit\n"}); #$ssh->capture({stdin_data => "exit\n"}); undef $ssh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::OpenSSH - page not loading completely
by Eliya (Vicar) on Apr 16, 2012 at 09:51 UTC | |
by comanche008 (Initiate) on Apr 16, 2012 at 11:46 UTC | |
by Eliya (Vicar) on Apr 16, 2012 at 13:27 UTC | |
by comanche008 (Initiate) on Apr 16, 2012 at 15:02 UTC | |
by Eliya (Vicar) on Apr 16, 2012 at 16:08 UTC | |
|