设置debug之后,显示如下: DA-test-x64: Reading configuration data /root/.ssh/config DA-test-x64: Reading configuration data /etc/ssh_config DA-test-x64: Allocated local port 1022. DA-test-x64: Connecting to 192.168.10.88, port 22. DA-test-x64: Remote protocol version 2.0, remote software version OpenSSH_5.1 DA-test-x64: Net::SSH::Perl Version 1.34, protocol version 2.0. .A-test-x64: No compat match: OpenSSH_5.1 DA-test-x64: Connection established. DA-test-x64: Sent key-exchange init (KEXINIT), wait response. DA-test-x64: Algorithms, c->s: 3des-cbc hmac-sha1 none DA-test-x64: Algorithms, s->c: 3des-cbc hmac-sha1 none DA-test-x64: Entering Diffie-Hellman Group 1 key exchange. DA-test-x64: Sent DH public key, waiting for reply. DA-test-x64: Received host key, type 'ssh-dss'. DA-test-x64: Host '192.168.10.88' is known and matches the host key. DA-test-x64: Computing shared secret key. DA-test-x64: Verifying server signature. DA-test-x64: Waiting for NEWKEYS message. DA-test-x64: Send NEWKEYS. DA-test-x64: Enabling encryption/MAC/compression. DA-test-x64: Sending request for user-authentication service. DA-test-x64: Service accepted: ssh-userauth. DA-test-x64: Trying empty user-authentication request. DA-test-x64: Authentication methods that can continue: publickey,keyboard-interactive. DA-test-x64: Next method to try is publickey. Permission denied at test.ssh.pl line 6
怎么会读取.ssh/config文件和/etc/ssh_config文件? 在 2012年7月19日 下午12:44,Fayland Lam <[email protected]>写道: > you can add debug => 1 see what happens. Thanks > > 2012/7/19 Gary Jsz <[email protected]>: > > 大家好! > > > > 今天测试Net::SSH::Perl模块,代码内容如下: > > > > #!/usr/bin/perl -w > > use strict; > > use Net::SSH::Perl; > > > > my $ssh = Net::SSH::Perl -> new('192.168.10.88', protocol=>2); > > $ssh->login('gary', 'linux'); > > $ssh->cmd("ls -al /tmp/"); > > > > > > > > 执行的时候报权限问题,全部信息如下: > > > > Permission denied at test.ssh.pl line 6 > > > > > > > > 还请大家给指点一二,谢谢! > > > > > > -- > > [email protected] > > > > -- > > 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 > > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > > 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 > > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > > > > -- > Fayland Lam // http://www.fayland.org/ > > -- > 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > > -- [email protected] -- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
