SSH public RSA key errors

Seen these before when trying to login via SSH with your new RSA public key?

Nov 2 12:09:17 hostname sshd[12712]: error: buffer_get_ret: trying to get more bytes 257 than in buffer 73
Nov 2 12:09:17 hostname sshd[12712]: error: buffer_get_string_ret: buffer_get failed
Nov 2 12:09:17 hostname sshd[12712]: error: buffer_get_bignum2_ret: invalid bignum
Nov 2 12:09:17 hostname sshd[12712]: error: key_from_blob: can't read rsa key
Nov 2 12:09:17 hostname sshd[12712]: error: key_read: key_from_blob AAAAB3N[...] failed

In my case these were the result of copying a public key from e-mail, which tends to mangle long text lines. I usually don’t have this problem because I use the ssh-copy-id script to copy my keys to a remote host before attempting to log in.


4 Comments on “SSH public RSA key errors”

  1. […] Google search results led me to clues here and here. My next issue was getting those newlines out, which apparently was an issue, vim complained no /n […]

  2. Jason Lenz says:

    Thank you! Your solution worked perfectly for me.

  3. Vinoth says:

    The issue is because of the the authorized keys file, when you are trying to configre password less Logins
    Sometimes when you do copy and paste this wont work,
    Solution : Try to transfer the rsa key file via ftp/sftp to the destination host and rename the file as in required user home .ssh directory to fix the issue


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s