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

Posted on February 6th, 2009 in General,Linux System Administration by Brandon

I ran across this cryptic error message in an SSH log file today:

Feb  7 03:33:21 hostname sshd[19439]: error: buffer_get_ret: trying to get more bytes 4 than in buffer 0
Feb  7 03:33:21 hostname sshd[19439]: fatal: buffer_get_int: buffer error

The problem is actually a corrupt line in a users ~/.ssh/authorized_keys file. This user had copy/pasted a new key into his authorized_keys file and it had a newline after the ssh-rsa. Strangely enough, people were still able to authenticate if their key was above the corrupted line. Users whose key was listed below the corrupt line were not able to log in.

5 Responses to 'SSH Error: trying to get more bytes 4 than in buffer 0'

Subscribe to comments with RSS or TrackBack to 'SSH Error: trying to get more bytes 4 than in buffer 0'.


  1. on November 25th, 2010 at 10:00 am

    Thanks! I hit this too. You are right – the error is very cryptic.

  2. Daniel said,

    on September 30th, 2011 at 8:53 pm

    Thanks for this.

  3. ianr said,

    on October 18th, 2011 at 11:00 am

    I never in a thousand years would have figured this out by myself – thanks!

  4. paresh said,

    on January 13th, 2012 at 4:01 pm

    SSH2 0: trying to get more bytes than in ssh_buffer in cisco switch error ….

  5. Bladimir said,

    on December 23rd, 2013 at 5:00 pm

    This can also happen when known_host file is corrupted..

Post a comment

Please copy the string upYBq5 to the field below: