Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit a user ID comment or set a new default user ID in GnuPG?

Tags:

gnupg

I would like to either remove a user ID or update its comment or at least make another one the default. This is because it contains a comment that has a stupid typographic error. Like:

gpg> list

pub  4096R/xxxxxxxx  created: yyyy-mm-dd  expires: yyyy-mm-dd  usage: SCEA
                     trust: ultimate      validity: ultimate
sub  4096R/xxxxxxxx  created: yyyy-mm-dd  expires: yyyy-mm-dd  usage: SEA 
[ultimate] (1). My Name (comment with a stupid typo) <my-primary@email-address>
[ultimate] (2)  My Name <my-primary@email-address>
[ultimate] (3)  My Name <my-second@email-address>

How can I remove (1) or make (2) the main and default user ID. Everyone that imports my key sees (1). I tried to use --edit-key with primary 2, but all I get is

Please select exactly one user ID.

What to do?

like image 237
0__ Avatar asked Dec 25 '15 12:12

0__


1 Answers

You have to select the user ID to edit before running those commands. If you want to remove the first user ID, press 1return, which will highlight the first user ID with a star * between the number and user ID:

[ultimate] (1)* My Name (comment with a stupid typo) <my-primary@email-address>
[ultimate] (2)  My Name <my-primary@email-address>
[ultimate] (3)  My Name <my-second@email-address>

Now run deluid to delete it. You can also select multiple user IDs to delete at once. Similarly, to change the default user ID, select the new default (in the unmodified user ID list of your question, by pressing 2return) and run primary. Use 2return again to deselect.

You cannot edit a user ID (including it's comment). Deleting it also might not be what you want to achieve, if the key was already sent to the key server network, it will simply be merged again next time your receive the key from there (also, others will still see it). Instead, revoke it running revuid (not revkey as indicated in the first revision of this post), which will not delete it but mark it as superseded (which is something that will be synchronized throughout the key server network).

like image 136
Jens Erat Avatar answered Sep 21 '22 10:09

Jens Erat