【发布时间】:2015-10-08 14:36:18
【问题描述】:
我正在使用 windows 64 位活动 perl 5.20 sw 登录 linux/unix 服务器。 在同一台 Windows 机器上,我可以毫无问题地使用我的用户名和密码进行 ssh。但是当我使用以下脚本时,我得到了 权限被拒绝
(gssapi-keyex、gssapi-with-mic、公钥、密码、键盘交互)。
知道如何解决它吗? 谢谢
#!/Perl64/bin/
use strict;
use Net::SSH qw(sshopen2);
use strict;
my $host = '10.120.xx.xx';
my $user = 'user';
my $pass = 'password';
my $cmd = '/bin/sh';
my @commands = ('df -k','free','uptime');
sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!";
while (<READER>) {
chomp();
print "$_\n";
}
close(READER);
close(WRITER);
【问题讨论】:
-
远程主机的密码在哪里提供?
标签: perl