in reply to Re: Net::SSH::Perl login
in thread Net::SSH::Perl login
Even after removing eval function, still the cursor just blinks and doesn't go further to fetch the command result. I changed my code to be very simple like below:
use Strict; use warnings; use Net::SSH::Perl; use Net::SSH2; $ENV{HOME} = "PATH"; print "Server Name to Connect:"; chomp($host = <STDIN>); print "User Name to Login:";chomp($LoginName = <STDIN>); print "Password for $LoginName:";chomp($pswd = <STDIN>); #!/usr/bin/perl -w my $command = "date"; my $ssh = Net::SSH::Perl->new($host); my $status = $ssh->login($LoginName,$pswd); my($stdout,$stderr,$exit) = $ssh->cmd($command); print "$stdout\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::SSH::Perl login
by vinoth.ree (Monsignor) on Jun 11, 2014 at 12:00 UTC |