ssh hangs on login

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

When I try to ssh to my server, it just hangs:

me@local$ ssh -p myport myserver
<nothing happens, it just hangs...>

now with debug on:

me@local$ slogin -p myport -v -l me myserver
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [] port 13117.
debug1: Connection established.
debug1: identity file /home/ohad/.ssh/identity type -1
debug1: identity file /home/ohad/.ssh/id_rsa type 1
debug1: identity file /home/ohad/.ssh/id_dsa type 2
<again, nothing happens now, this just hangs..>

tcpdump - we can see a TCP handshake and that's it:

me@host$ sudo tcpdump -i eth0 host myserver
tcpdump: verbose output suppressed, use -v or -vv for full protocol
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
08:32:00.163522 IP local.42685 > myserver.myport: S
1710591164:1710591164(0) win 5840 <mss 1460,sackOK,timestamp 389343288
0,nop,wscale 7>
08:32:00.384690 IP myserver.myport > local.42685: S
851525410:851525410(0) ack 1710591165 win 5792 <mss
1452,sackOK,timestamp 2271640119 389343288,nop,wscale 5>
08:32:00.384710 IP local.42685 > myserver.myport: . ack 1 win 46
<nop,nop,timestamp 389343343 2271640119>

any suggestions?
(note that this setup has been working for a very long time without
any problem..)


Re: ssh hangs on login

A couple of suggestions:
- check you haven't changed firewall settings recently
  - switch off to test (service iptables stop)

- Run sshd server in debug on the target server, while running client
in debug too. If possible, try this on an alternative port for
testing, e.g..
/[root@localhost ~]# /usr/sbin/sshd -p222 -d
debug1: sshd version OpenSSH_4.7p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-p222'
debug1: rexec_argv[2]='-d'
debug1: Bind to port 222 on ::.
Server listening on :: port 222.
. this output on 1 terminal...

- Run this on the client...
$ ssh -v -p222 localhost
OpenSSH_4.7p1, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /local/home/jon/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [] port 222.
debug1: Connection established.

You should see the server respond with something like...
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from port 45592

Good luck...

Site Timeline