|
For a GPG key pair has been generated, in which users want to name, comment information is modified, then how to do it?
Rekeying?
Modify the generated key?
Rekeying is very simple, but this will lead to the selection of multiple keys, then here already generated key to modify the method to make a presentation.
Below heard slowly come:
1, first, the command line, type the following command to modify the interface of key information:
gpg --edit-key test@test.com
gpg (GnuPG) 1.4.16; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
The private key is available.
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Absolute (1). Yy_test1 (yy_email_gpg)
gpg>
2, using the list you can see the current user's key and user ID (or user name, comments):
gpg> list
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Absolute (1) * yy_test1 (yy_email_gpg)
3, add a user ID:
gpg> adduid
Real Name: [yy] yy Ming Xiao
E-mail address: test@test.com
Note: DSC security
You selected this user ID:
"[Yy] yy Ming Xiao (DSC security) "
Change the name (N), Note (C), e-mail address (E) or OK (O) / Quit (Q)? O
You need to enter a password to unlock the user's private key: "yy_test1 (yy_email_gpg) "
4096 RSA keys, key number DPPPPPPP, established in 2015-03-16
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Absolute (1) * yy_test1 (yy_email_gpg)
Unknown (2). [Yy] yy Ming Xiao (DSC security)
4, delete / write-off of the original UID information:
First use uid 1 to delete the selected identification number, where we want to remove the identification number is 1;
gpg> uid 1
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Absolute (1) * yy_test1 (yy_email_gpg)
Unknown (2). [Yy] yy Ming Xiao (DSC security)
Here can be divided into two cases,
1), has not been uploaded to the key server key to delete the key.
2), has been uploaded to the key server for a key, the original key if we are not then used, then the write-off logo on the use command to log off.
1), has not been uploaded to the key server key to delete the key.
Absolute (1) * marked with * means that the currently selected identity, then use the delete command deluid No. 1 can be identified:
gpg> deluid
Really remove this user ID? (Y / N) y
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Unknown (1). [Yy] yy Ming Xiao (DSC security)
2), has been uploaded to the key server for a key, the original key if we are not then used, then the write-off logo on the use command to log off.
gpg> revuid
Really revoke this user ID? (Y / N) y
Please select the reason for the revocation:
0 = Reason Not specified
4 = user ID is no longer valid
Q = Cancel
(You might want to select 4)
What is your decision? 4
Please enter a description (optional); blank line to the end:
>
Revocation Reason: The user ID is no longer valid
(Not given description)
Is this okay? (Y / N) y
You need to enter a password to unlock the user's private key: "yy_test1 (yy_email_gpg) "
4096 RSA keys, key number DPPPPPPP, established in 2015-03-16
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
[Revoked] (1). Yy_test1 (yy_email_gpg)
Unknown (2). [Yy] yy Ming Xiao (DSC security)
5, set up a trust relationship to generate a new identity:
gpg> trust
pub 4096R / DPPPPPPP Created: 2015-03-16 Valid to: 2016-03-15 may be used: SC
Trust: Absolute effectiveness: Absolute
sub 4096R / PDDDDDDD Created: 2015-03-16 Valid to: 2016-03-15 may be used: E
Unknown (1). [Yy] yy Ming Xiao (DSC security)
Do you trust this user to correctly verify (check other users' identity cards, checks through different channels
Fingerprints, etc.)?
1 = I do not know or I do not answer
2 = I do not believe
3 = I barely believe
4 = I totally believe
5 = I absolutely believe
m = back to the main menu
What is your decision? 5
Do you really want to set this key to ultimate trust? (Y / N) y
After setting, in front of "unknown (1)." Changes to "absolute (1).", Which is generally carried out after the first save operation You can view the list again.
6, save for modification, use the save command.
gpg> save
/ ************************************************* ********************
* Author: Samson
* Date: 03/18/2015
* Test platform:
* Gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
* GNU bash, 4.3.11 (1) -release (x86_64-pc-linux-gnu)
* ************************************************* ****************** / |
|
|
|