Output with ssh -vvv ===================== Tue Feb 12 04:10:04 HKT 2002 OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090600f debug1: Seeding random number generator^M debug1: Rhosts Authentication disabled, originating port will not be trusted.^M debug1: ssh_connect: getuid 0 geteuid 0 anon 1^M debug1: Connecting to vtms_hbbak [10.37.70.213] port 22.^M debug1: Connection established.^M debug3: Bad RSA1 key file /root/.ssh/identity.^M debug2: key_type_from_name: unknown key type '-----BEGIN'^M debug3: key_read: no key found^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090600f debug1: Seeding random number generator^M debug1: Rhosts Authentication disabled, originating port will not be trusted.^M debug1: ssh_connect: getuid 0 geteuid 0 anon 1^M debug1: Connecting to MYHOST [10.20.30.40] port 22.^M debug1: Connection established.^M debug3: Bad RSA1 key file /root/.ssh/identity.^M debug2: key_type_from_name: unknown key type '-----BEGIN'^M debug3: key_read: no key found^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug3: key_read: no space^M debug2: key_type_from_name: unknown key type '-----END'^M debug3: key_read: no key found^M debug1: identity file /root/.ssh/identity type 1^M debug1: unknown identity file /root/.ssh/id_rsa^M debug1: identity file /root/.ssh/id_rsa type -1^M debug1: unknown identity file /root/.ssh/id_dsa^M debug1: identity file /root/.ssh/id_dsa type -1^M ssh_exchange_identification: read: Connection reset by peer^M debug1: Calling cleanup 0x8061610(0x0)^M Tue Feb 12 06:11:39 HKT 2002 ============================== Normally should read ===================== ..... debug1: unknown identity file /root/.ssh/id_rsa^M debug1: identity file /root/.ssh/id_rsa type -1^M debug1: unknown identity file /root/.ssh/id_dsa^M debug1: identity file /root/.ssh/id_dsa type -1^M debug1: Remote protocol version 1.99, remote software version OpenSSH_2.5.2p2^M debug1: match: OpenSSH_2.5.2p2 pat ^OpenSSH^M .....
what is the timeout issue? timeouts can be caused by filters that maintain connection state and have timeouts; or TCP keepalives or ??? this should probably be "invalid"
Before I make ssh connection, the time is 'Tue Feb 12 04:10:04 HKT 2002'. After the ssh failed to connect (ssh_exchange_identification: read: Connection reset by peer), the time is Tue Feb 12 06:11:39 HKT 2002. ssh waits for 2 hrs before declaring the connection fails!
OpenSSH doesn't second-guess your TCP stacks connect() function. There are patches to implement shorter timeouts, see Bug #91
Mass change of RESOLVED bugs to CLOSED