Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can simply open up the pubkey and change the comment after the ==s, but is the comment field decided upon at creation stored in the private key as well? If so, how can I change that field without generating an entirely new key from scratch?

share|improve this question
Open the private key file and see for yourself? – Daniel Beck Nov 26 '11 at 22:12
See @jhcaiced's response below; that apparently won't work, which is what I feared. – ELLIOTTCABLE Nov 27 '11 at 15:31

I just did a small test modifying the "Comment:" line of my private RSA key and it appears to be fixed at creation of the key.

It is a RSA key generated with Putty, and after modifying the comment in the key, the passwd did not work, i have to reverse the edit to the same original comment for it to work again.

share|improve this answer
I can confirm this. I had tried the same before and i couldn't do it by text editing. I ended up creating a new key by importing the same private key details, changing the comment and saving it again, using the tools included with putty. – Vijay Dec 14 '12 at 8:07
man ssh-keygen -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. I tried creating an RSA key with -C to specify a comment at creation time. It doesn't do anything. I have lots of RSA keys I'd like to be able to distinguish when running ssh-add -l. – Cocoabean Oct 29 '13 at 6:56

Your Answer


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.