Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've created an RSA keypair that I used for SSH, and it includes my email address. (At the end of the public key.)

I've now changed my email address.

Is it possible to change the email address on the key, or is it part of the key and I would have to make a new one?

share|improve this question
add comment

2 Answers

up vote 19 down vote accepted

I've created an RSA keypair that I used for SSH, and it includes my email address. (At the end of the public key.)

That part of an ssh key is just a comment. You can change it to anything you want at any time. It doesn't even need to be the same on different servers. You can remove it as well. It is only there to help you or someone else figure out what to delete when you have many keys in an authorized_keys file and you need to revoke or change one of them.

ssh-rsa AAAAB3N....NMqKM= this_is_a_comment

When I create my keys with ssh-keygen I usually use a command like this to set a different comment. I don't think the username@host is very useful. You can certainly put it whatever comment that you like that will be useful to you and any other admins to help identify who the key belongs to.

ssh-keygen ... -C YYYYMMDD_surname_givenname
share|improve this answer
1  
So happy I don't have to change my keys... –  Ram Rachum Sep 7 '11 at 23:33
add comment

You can change the comment for RSA1 keys using ssh-keygen -c.

from the ssh-keygen manpage:

 -c      Requests changing the comment in the private and public

key files. This operation is only supported for RSA1 keys. The program will prompt for the file containing the private keys, for the passphrase if the key has one, and for the new comment.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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