开发者

problem making an SSH session using perl

use Net::SSH::Perl;
my $ssh = Net::SSH::Perl开发者_如何学C->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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜