Linux – SSH one way but reverse hangs

linuxssh

I have a peculiar situation where i can ssh into server1 from server2 but cannot ssh into server2 from server1. /etc/hosts is fine as it has all the correct IP's but ssh with the ip-s also hangs.

here is a sample of the logs
root@server1 ~]# ssh -v -v -v server2
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server2 [192.168.0.2] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug3: Not a RSA1 key file /root/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1

I get stuck there eternally.

Thanks for your help

Best Answer

SSH is not symmetric in terms of the encryption process, so it working one direction does not guarantee that it'll work the other direction. From the given dump file, it looks like a malformed keyfile on the target is preventing SSH from completing authentication.