34

I was adding one of my public keys to the authorized_keys on one of my servers when I realized that at the end of my public SSH key there is my email:

$ cat .ssh/id_rsa.pub
ssh-rsa AAAA[...lots of characters...]bpL johndoe@gmail.com
  • Why is my email address at the end of the key?
  • Does it have any specific purpose?
  • Can I write anything I want in my authorized_keys file? Like for instance:

    ssh-rsa AAAA[...lots of characters...]bpL John Doe (Home PC)
    
Enrique Moreno Tent
  • 3,289
  • 11
  • 41
  • 65
  • 1
    This is the comment field, so yes, you could put anything there. Its purpose is solely to help the user identify keys, particularly after they are concatenated into an `authorized_keys` file on a server. – user4556274 Jul 23 '16 at 11:19

1 Answers1

25
  1. Most likely to identify who created the key.

  2. It is just a comment. But as said at 1: probably so you know you created it. Useful when more than 1 administrator is administrating the system.

  3. Yes, you can add anything in place of your e-mail. And since it is the last part of it you do not have to use anything special for spaces etc.

    Extra: ssh-keygen -c to change it for RSA1 keys (only works for RSA1).

Rinzwind
  • 293,910
  • 41
  • 570
  • 710