For some reason sshd is reading from my authorized_keys file a new line that does not exist. I generated the keys with puttygen, copied the public key text in as required, concatenated the key into one long string starting with ssh-rsa and according to Vi and nano, there are no extra lines.

However, from my secure log, every time I try to use this it's a problem. I get the trying to get more bytes than in buffer error as well as error: key_from_blob: can't read rsa key then the rest of the error which shows the \n after the key comment. It will also do \n even if I remove the comment.

Any ideas what is the problem?

1 Answer 1


When copying keys into your $HOME/.ssh/authorized_keys file you have to make sure that the the string pasted is one continuous string with no breaks whatsoever.

I typically will open this file in vim and make sure that the strings are correct. They should appear as such:

ssh-dss ....key1.... root@someserver1.com
ssh-dss ....key2.... root@someserver2.com

You can also use this command to confirm that your keys contained in your $HOME/.ssh/authorized_keys file are correct like so:

$ while read line;do ssh-keygen -lf /dev/stdin <<<$line; 
    done <~/.ssh/authorized_keys 
1024 ....fingerprint #1....  root@someserver1 (DSA)
2048 ....fingerprint #2....  user@someserver2 (RSA)
2048 ....fingerprint #3....  user@someserver3 (RSA)

NOTE: The "fingerprints" above are of the form: "1c:ea:12:ef:ab:0a:12:c3:12:55:33:ad:98:55:33:ac", for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.