Show quoted text> e.g. tried with "LANG= ./perl_ssh.pl"
for reproducing:
perl_ssh.pl :
#! /usr/bin/perl
use strict;
use warnings;
use Net::SSH::Perl;
my $host = "testbox";
my $user = "root";
my $pass = "xxxxxxx";
my $cmd = "/bin/uname -inr";
my $ssh = Net::SSH::Perl->new($host,debug => 6,interactive => 0,
protocol => '2,1',use_pty => 'false');
$ssh->login("root", "xxxxx");
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print "-- $stdout, $stderr, $exit \n";
g19:/tmp # LANG= ./perl_ssh.pl
g19: Reading configuration data /root/.ssh/config
g19: Reading configuration data /etc/ssh_config
g19: Allocated local port 1020.
g19: Connecting to testbox, port 22.
g19: Remote version string: SSH-1.99-OpenSSH_4.2
g19: Remote protocol version 1.99, remote software version OpenSSH_4.2
g19: Net::SSH::Perl Version 1.30, protocol version 2.0.
g19: No compat match: OpenSSH_4.2.
g19: Connection established.
g19: Sent key-exchange init (KEXINIT), wait response.
g19: Algorithms, c->s: 3des-cbc hmac-sha1 none
g19: Algorithms, s->c: 3des-cbc hmac-sha1 none
g19: Entering Diffie-Hellman Group 1 key exchange.
g19: Sent DH public key, waiting for reply.
g19: Received host key, type 'ssh-dss'.
g19: Host 'testbox' is known and matches the host key.
g19: Computing shared secret key.
g19: Verifying server signature.
g19: Waiting for NEWKEYS message.
g19: Enabling incoming encryption/MAC/compression.
g19: Send NEWKEYS, enable outgoing encryption/MAC/compression.
g19: Sending request for user-authentication service.
g19: Service accepted: ssh-userauth.
g19: Trying empty user-authentication request.
g19: Authentication methods that can continue:
publickey,keyboard-interactive.
g19: Next method to try is publickey.
Permission denied at ./perl_ssh.pl line 14