You are not logged in.

#1 2008-09-19 18:48:57

pjjanak
Member
Registered: 2008-08-17
Posts: 128

[SOLVED] SSH Exchange Identification Error

So, for a few weeks now I have been experiencing issues when trying to SSH into both of my Arch boxes. I get the following output when running 'ssh -vvv':

OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 129.21.146.199 [129.21.146.199] port 22.
debug1: Connection established.
debug1: identity file /home/peter/.ssh/identity type -1
debug3: Not a RSA1 key file /home/peter/.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
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 /home/peter/.ssh/id_rsa type 1
debug3: Not a RSA1 key file /home/peter/.ssh/id_dsa.
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/peter/.ssh/id_dsa type 2
ssh_exchange_identification: Connection closed by remote host

And this only happens when I'm SSHing into Arch boxes. It's quite frustrating. I've tried remaking my rsa and dsa keys, deleting them, everything and still can't figure it out. Help!

Peter

Last edited by pjjanak (2008-09-25 03:42:53)

Offline

#2 2008-09-19 19:16:55

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,045

Re: [SOLVED] SSH Exchange Identification Error

Looks like your  /home/peter/.ssh/id_rsa  is invalid or corrupt.

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
.
.
.
-----END RSA PRIVATE KEY-----

1000

Offline

#3 2008-09-19 19:20:47

pjjanak
Member
Registered: 2008-08-17
Posts: 128

Re: [SOLVED] SSH Exchange Identification Error

Well, I thought that too, which is why I recreated my rsa key (after deleting the old one). And it still wouldn't work. I can SSH into any other box, more importantly I can SSH into my work computer which only accepts rsa key authentication.

Peter

Edit: Also important to note is that I feel it's the remote machines fault, not the fault of the local machine, namely because my girlfriend's Mac can't SSH into either of my Arch boxes either.

Last edited by pjjanak (2008-09-19 19:26:31)

Offline

#4 2008-09-19 21:26:55

ravster
Member
From: Queen's U, Kingston, Canada
Registered: 2004-05-02
Posts: 285
Website

Re: [SOLVED] SSH Exchange Identification Error

I'm having a similar problem
http://bbs.archlinux.org/viewtopic.php?pid=422485
The only thing in my ~/.ssh/ directory is a known_hosts file. There is nothing else in there.

Offline

#5 2008-09-19 22:34:28

tam1138
Member
Registered: 2007-09-10
Posts: 237

Re: [SOLVED] SSH Exchange Identification Error

Please post /etc/ssh/sshd_config from the server.

Offline

#6 2008-09-20 01:02:34

pjjanak
Member
Registered: 2008-08-17
Posts: 128

Re: [SOLVED] SSH Exchange Identification Error

#    $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile    .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem    sftp    /usr/lib/ssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#    X11Forwarding no
#    AllowTcpForwarding no
#    ForceCommand cvs server

Peter

Offline

#7 2008-09-20 06:36:28

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,045

Re: [SOLVED] SSH Exchange Identification Error

I think I figured it out.

The default value for ServerKeyBits got upgraded from 768 to 1024 in the new OpenSSH release.
If you didn't modify your original /etc/ssh/sshd_config then it would be normal behaviour for pacman to replace it with the version from the newer package, where that variable is also commented and thus the defaults are assumed.

Workaround 1: Regenerate your host key (as seen in /etc/rc.d/sshd)
Workaround 2: Change ServerKeyBits back to 768.

Last edited by byte (2008-09-20 06:39:00)


1000

Offline

#8 2008-09-20 14:13:55

pjjanak
Member
Registered: 2008-08-17
Posts: 128

Re: [SOLVED] SSH Exchange Identification Error

Changing the ServerKeyBits did nothing. I still get the same error. And how would one go about regenerating the host key?

Peter

Offline

#9 2008-09-20 23:54:46

Ruckus
Member
From: Danville IL
Registered: 2007-02-17
Posts: 204
Website

Re: [SOLVED] SSH Exchange Identification Error

I just re-installed arch at home, and today I keep getting this error from work (windows box using putty). I'll take a look and see if I can't figure it out when I get off work.

Offline

#10 2008-09-22 13:42:12

pjjanak
Member
Registered: 2008-08-17
Posts: 128

Re: [SOLVED] SSH Exchange Identification Error

Has anyone made any head way with this?

Peter

Offline

#11 2008-09-24 15:06:45

Ruckus
Member
From: Danville IL
Registered: 2007-02-17
Posts: 204
Website

Re: [SOLVED] SSH Exchange Identification Error

I've figured it out, it's so silly I'm a bit embarrased. For me at least, this error was caused by my /etc/hosts.allow and /etc/hosts/deny not allowing sshd access to sshd. Obviously I just put "sshd : ALL" in /etc/hosts.allow and it started working.

Last edited by Ruckus (2008-09-24 15:44:55)

Offline

#12 2008-09-25 03:42:34

pjjanak
Member
Registered: 2008-08-17
Posts: 128

Re: [SOLVED] SSH Exchange Identification Error

That was the ticket. That's mildly embarrassing :-p Thanks guys.

Peter

Offline

#13 2008-09-25 10:10:00

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,045

Re: [SOLVED] SSH Exchange Identification Error

Heh, tcp_wrappers? That's normally the first thing you get asked regarding SSH issues. Seems like all the debug output made me blind for the last line.


1000

Offline

#14 2009-05-11 12:11:47

corstar
Member
From: Perth, Western Australia
Registered: 2008-05-05
Posts: 27
Website

Re: [SOLVED] SSH Exchange Identification Error

Ruckus wrote:

I've figured it out, it's so silly I'm a bit embarrased. For me at least, this error was caused by my /etc/hosts.allow and /etc/hosts/deny not allowing sshd access to sshd. Obviously I just put "sshd : ALL" in /etc/hosts.allow and it started working.

This fixed the problem for me too. Very simple solution.

Last edited by corstar (2009-05-11 12:45:49)

Offline

Board footer

Powered by FluxBB