#!/apps/perl/bin/perl use Net::SSH::Perl ; chomp(my $this_host = `hostname`); print "Enter host name : [$this_host] "; chomp(my $host = ); print "\n"; my $this_user = scalar getpwuid($<); print "Enter your username : [$this_user] "; chomp(my $user = ); print "And your password: "; chomp(my $pass =); $scon = Net::SSH::Perl->new ($host || $this_host, protocol => 2, debug => 1); $scon->login($user || $this_user,$pass); print "looking around ...\n"; my($output,$errors,$exit) = $scon->cmd("ls -l"); print "output:$output|\n"; print "errors:$errors|\n"; print "exit:$exit|\n"; #### Enter a host name to connect to: [abc123] xyz123 Enter your username on that host: [login12] login12 And your password: log123 abc123: Reading configuration data /home/dba/.ssh/config abc123: Reading configuration data /etc/ssh_config abc123: Connecting to xyz123, port 22. abc123: Remote version string: SSH-2.0-OpenSSH_4.1 abc123: Remote protocol version 2.0, remote software version OpenSSH_4.1 abc123: Net::SSH::Perl Version 1.30, protocol version 2.0. abc123: No compat match: OpenSSH_4.1. abc123: Connection established. abc123: Sent key-exchange init (KEXINIT), wait response. abc123: Algorithms, c->s: 3des-cbc hmac-sha1 none abc123: Algorithms, s->c: 3des-cbc hmac-sha1 none abc123: Entering Diffie-Hellman Group 1 key exchange. abc123: Sent DH public key, waiting for reply. abc123: Received host key, type 'ssh-dss'. abc123: Host 'xyz123' is known and matches the host key. abc123: Computing shared secret key. abc123: Verifying server signature. abc123: Waiting for NEWKEYS message. abc123: Enabling incoming encryption/MAC/compression. abc123: Send NEWKEYS, enable outgoing encryption/MAC/compression. abc123: Sending request for user-authentication service. abc123% #### write(4, "\0\0\0\f\n15C6 DBD V qFB".., 16) = 16 getcontext(0xFFBEF620) amaprd61: Sending request for user-authentication service. write(2, " a m a p r d 6 1 : S e".., 59) = 59 getcontext(0xFFBEF530) getcontext(0xFFBEF388) getcontext(0xFFBEF530) getcontext(0xFFBEF388) write(4, " }C2F0F587A6 ~\n9E a18 =".., 52) Err#32 EPIPE Received signal #13, SIGPIPE [default] *** process killed ***