tags:

views:

63

answers:

1
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new('$host',22);
$ssh->login('$user','$pass');
my $out = $ssh->cmd("show clock");
print $out;

I have the above script to have an ssh session using perl but I'm having the error message "Can't map service name 'ssh' to port number". I'm using Windows OS. Please advise me where I'm wrong.

+1  A: 

Try adding ssh to your services file. The services file is located at:

%SystemRoot%\system32\drivers\etc\services

The line that you'll want to add will look like:

ssh 22/tcp  # Secure Shell Login
Joel