SSHD Error: buffer_get_ret: trying to get more bytes 4 than in buffer 0

Posted by Daniel | Posted in Operating Systems, Software | Posted on October 2, 2011

0

If you have run in to an error similar to this one while setting up SSH key-based authentication in your /var/log/secure log file:

1
2
Oct  2 21:12:05 phptest sshd[31998]: error: buffer_get_ret: trying to get more bytes 4 than in buffer 0
Oct  2 21:12:05 phptest sshd[31998]: fatal: buffer_get_int: buffer error

Check to make sure your public key in ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2 is on one line. The prefix “ssh-rsa” followed by a space and then your key should all be on one line. You may also have a comment after that describing the key on another line, but the whole prefix and key have to be on the same line or you will get an error similar to the above in your /var/log/secure log file. I see people running in to this problem frequently when copying a public key out of PuttyGen, which only has “ssh-rsa” on the first line of the output key.

Write a comment

Page optimized by WP Minify WordPress Plugin