Yogesh
Yogesh

Reputation: 21

problem making an SSH session using perl

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.

Upvotes: 2

Views: 324

Answers (1)

Joel
Joel

Reputation: 3483

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

Upvotes: 1

Related Questions