Net-SFTP - Net-SFTP hangs after login and authentication (SSH2 not working either)

Posted on Mon Jan 15 21:12:22 2007 by emanuel
Net-SFTP hangs after login and authentication (SSH2 not working either)
Hi, I am working on a windows XP machine trying to communicate with a Centos 4 Linux. I am trying to contact with sftp but something is going wrong... here is the output: laptop: Reading configuration data 0/.ssh/config laptop: Reading configuration data /etc/ssh_config laptop: Connecting to ###.##.##.##, port 22. laptop: Remote version string: SSH-1.99-OpenSSH_3.9p1 laptop: Remote protocol version 1.99, remote software version OpenSSH_3.9p1 laptop: Net::SSH::Perl Version 1.30, protocol version 2.0. laptop: No compat match: OpenSSH_3.9p1. laptop: Connection established. laptop: Sent key-exchange init (KEXINIT), wait response. laptop: Algorithms, c-s: 3des-cbc hmac-sha1 none laptop: Algorithms, s-c: 3des-cbc hmac-sha1 none laptop: Entering Diffie-Hellman Group 1 key exchange. laptop: Sent DH public key, waiting for reply. laptop: Received host key, type 'ssh-dss'. laptop: Host ##.##.##.## is known and matches the host key. laptop: Computing shared secret key. laptop: Verifying server signature. laptop: Waiting for NEWKEYS message. laptop: Enabling incoming encryption/MAC/compression. laptop: Send NEWKEYS, enable outgoing encryption/MAC/compression. laptop: Sending request for user-authentication service. laptop: Service accepted: ssh-userauth. laptop: Trying empty user-authentication request. laptop: Authentication methods that can continue: publickey,gssapi-with-mic,password. laptop: Next method to try is publickey. laptop: Next method to try is password. laptop: Trying password authentication. laptop: Login completed, opening dummy shell channel. laptop: channel 0: new [client-session] laptop: Requesting channel_open for channel 0. laptop: channel 0: open confirm rwindow 0 rmax 32768 laptop: channel 1: new [client-session] laptop: Requesting channel_open for channel 1. laptop: Sending subsystem: sftp laptop: Requesting service subsystem on channel 1. laptop: channel 1: open confirm rwindow 0 rmax 32768 laptop: sftp: Sending SSH2_FXP_INIT This is where it hangs... My script is : my $sftp = Net::SFTP->new($host, "user", $user, "password", $pass, "debug", "true"); and nothing else is working afterward since it hangs. I have tryed to work with NET-SSH-PERL and while trying to make it work on SSH2 it doesnt work for me but in SSH1 it connects and executes command. the SSH script : my $ssh = Net::SSH::Perl->new($host, protocol=>"2", debug=>"true"); print "Logging in...\n"; my $rc = $ssh->login($user, $pass, "true"); print "rc=$rc\n"; print "Executing command\n"; my ($out, $err, $exit) = $ssh->cmd("ls /tmp", "\n"); the SSH output (where it hangs at the end..): laptop: Reading configuration data 0/.ssh/config laptop: Reading configuration data /etc/ssh_config laptop: Connecting to ##.##.##.##, port 22. laptop: Remote version string: SSH-1.99-OpenSSH_3.9p1 laptop: Remote protocol version 1.99, remote software version OpenSSH_3.9p1 laptop: Net::SSH::Perl Version 1.30, protocol version 2.0. laptop: No compat match: OpenSSH_3.9p1. laptop: Connection established. Logging in... laptop: Sent key-exchange init (KEXINIT), wait response. laptop: Algorithms, c-s: 3des-cbc hmac-sha1 none laptop: Algorithms, s-c: 3des-cbc hmac-sha1 none laptop: Entering Diffie-Hellman Group 1 key exchange. laptop: Sent DH public key, waiting for reply. laptop: Received host key, type 'ssh-dss'. laptop: Host ##.##.##.## is known and matches the host key. laptop: Computing shared secret key. laptop: Verifying server signature. laptop: Waiting for NEWKEYS message. laptop: Enabling incoming encryption/MAC/compression. laptop: Send NEWKEYS, enable outgoing encryption/MAC/compression. laptop: Sending request for user-authentication service. laptop: Service accepted: ssh-userauth. laptop: Trying empty user-authentication request. laptop: Authentication methods that can continue: publickey,gssapi-with-mic,password. laptop: Next method to try is publickey. laptop: Next method to try is password. laptop: Trying password authentication. laptop: Login completed, opening dummy shell channel. laptop: channel 0: new [client-session] laptop: Requesting channel_open for channel 0. rc=true Executing command laptop: channel 0: open confirm rwindow 0 rmax 32768 laptop: channel 1: new [client-session] laptop: Requesting channel_open for channel 1. laptop: Entering interactive session. laptop: Sending command: ls /tmp laptop: Requesting service exec on channel 1. laptop: channel 1: send eof laptop: channel 1: open confirm rwindow 131071 rmax 32768 obviously, no command is executed and the system is left hanging. Any suggestions?? Thanks!
Direct Responses: 4447 | 4696 | Write a response