use Net::SSH::Perl; my $fw = Net::SSH::Perl->new( 'server1', debug => 1 ); $fw->login( 'root','1234567890'); my ($stdout, $stderr, $exit) = $fw->cmd('ls -lh /etc'); print $stdout; ############## OUTPRINT DEBUG ######## client_win2k: Reading configuration data /.ssh/config client_win2k: Reading configuration data /etc/ssh_config client_win2k: Connecting to server1, port 22. client_win2k: Socket created, turning on blocking... client_win2k: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian-8.sarge.4 client_win2k: Net::SSH::Perl Version 1.29, protocol version 2.0. client_win2k: No compat match: OpenSSH_3.8.1p1 Debian-8.sarge.4. client_win2k: Connection established. client_win2k: Sent key-exchange init (KEXINIT), wait response. client_win2k: Algorithms, c->s: 3des-cbc hmac-sha1 none client_win2k: Algorithms, s->c: 3des-cbc hmac-sha1 none client_win2k: Entering Diffie-Hellman Group 1 key exchange. client_win2k: Sent DH public key, waiting for reply. client_win2k: Received host key, type 'ssh-dss'. client_win2k: Host 'server1' is known and matches the host key. client_win2k: Computing shared secret key. client_win2k: Verifying server signature. client_win2k: Waiting for NEWKEYS message. client_win2k: Enabling incoming encryption/MAC/compression. client_win2k: Send NEWKEYS, enable outgoing encryption/MAC/compression. client_win2k: Sending request for user-authentication service. client_win2k: Service accepted: ssh-userauth. client_win2k: Trying empty user-authentication request. client_win2k: Authentication methods that can continue: publickey,keyboard-interactive. client_win2k: Next method to try is publickey. Permission denied at C:\Test\t.pl line 3