Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First:

$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Connecting to SSH servers gives this message:

$ ssh -vvv localhost
OpenSSH_5.3p1, OpenSSL 0.9.8m 25 Feb 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/charlie/.ssh/identity type -1
debug1: identity file /home/charlie/.ssh/id_rsa type -1
debug3: Not a RSA1 key file /home/charlie/.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/charlie/.ssh/id_dsa type 2
ssh_exchange_identification: Connection closed by remote host

My /etc/hosts.allow is as following:

sshd: ALLOW

/etc/hosts.deny is as following:

ALL: ALL: DENY

I have changed my /etc/ssh/sshd_conf as following:

ListenAddress 0.0.0.0
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


RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys

PasswordAuthentication no
share|improve this question

migrated from stackoverflow.com Mar 6 '10 at 17:10

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

Double check the perms on your .ssh dir and your .ssh/authorized_keys file. Those need to be chmod 700 and 600 respectively.

share|improve this answer
add comment

I'm pretty sure

sshd: ALLOW

is invalid syntax for hosts.allow. You probably mean ALL, not ALLOW.

share|improve this answer
add comment

I had a similar error message. I was trying to ssh from MacOS X 10.6.3 to Ubuntu Server 9.04.

I found out that denyhosts on Ubuntu would forcibly insert the following into by /etc/hosts.deny:

sshd: nnn.nnn.nnn.nnn

Even when deleting this entry and restarting denyhosts, this line would return.

In order to fix this, I followed this FAQ to remove my blocked IP address from the specified files in the WORKING_DIR (/var/lib/denyhosts in Ubuntu).

Mind you, as I write this, I am 20 minutes out of having resolved this as far as I can see - I shall advise if I experience a regression.

share|improve this answer
add comment

I had a similar problem and was solved by adding

sshd: ALL

to /etc/hosts.allow

share|improve this answer
add comment

Read your -vvv output again:

debug3: Not a RSA1 key file /home/charlie/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'

What's in /etc/ssh/ssh_config?

What do you get if you run telnet localhost 22?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.