Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # GPG Cheat Sheet
- ## Change expiration date of a key
- $ gpg --list-secret-keys
- sec 4096R/EAE1BF07 2013-07-04 [expires: 2017-07-05]
- uid Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
- uid Charles-Henri Bruyand <chbruyand@mayhem.fr>
- ssb 4096R/B92D1CF4 2013-07-04
- Edit the key
- $ gpg --edit-key EAE1BF07
- List the key and subkeys
- gpg> list
- pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2017-07-05 usage: SC
- trust: ultimate validity: ultimate
- sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
- [ultimate] (1). Charles-Henri Bruyand <chbruyand@mayhem.fr>
- [ultimate] (2) Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
- Select the primary key
- gpg> key 0
- pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2017-07-05 usage: SC
- trust: ultimate validity: ultimate
- sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
- [ultimate] (1). Charles-Henri Bruyand <chbruyand@mayhem.fr>
- [ultimate] (2) Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
- Use the `expire` command to update the expiration date
- ```
- gpg> expire
- Changing expiration time for the primary key.
- gpg: WARNING: no user ID has been marked as primary. This command may
- cause a different user ID to become the assumed primary.
- Please specify how long the key should be valid.
- 0 = key does not expire
- <n> = key expires in n days
- <n>w = key expires in n weeks
- <n>m = key expires in n months
- <n>y = key expires in n years
- Key is valid for? (0) 1y
- Key expires at Thu Jun 21 11:39:25 2018 CEST
- Is this correct? (y/N) y
- You need a passphrase to unlock the secret key for
- user: "Charles-Henri Bruyand <chbruyand@mayhem.fr>"
- 4096-bit RSA key, ID EAE1BF07, created 2013-07-04
- pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2018-06-21 usage: SC
- trust: ultimate validity: ultimate
- sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
- [ultimate] (1) Charles-Henri Bruyand <chbruyand@mayhem.fr>
- [ultimate] (2). Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
- ```
- Repeat the operation to edit subkeys using the `key` command to select them by index
- ```
- gpg> expire
- Changing expiration time for a subkey.
- Please specify how long the key should be valid.
- 0 = key does not expire
- <n> = key expires in n days
- <n>w = key expires in n weeks
- <n>m = key expires in n months
- <n>y = key expires in n years
- Key is valid for? (0) 1y
- Key expires at Thu Jun 21 11:41:31 2018 CEST
- Is this correct? (y/N) y
- You need a passphrase to unlock the secret key for
- user: "Charles-Henri Bruyand <chbruyand@mayhem.fr>"
- 4096-bit RSA key, ID EAE1BF07, created 2013-07-04
- pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2018-06-21 usage: SC
- trust: ultimate validity: ultimate
- sub* 4096R/B92D1CF4 created: 2013-07-04 expires: 2018-06-21 usage: E
- [ultimate] (1)* Charles-Henri Bruyand <chbruyand@mayhem.fr>
- [ultimate] (2). Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
- ```
- Save your changes
- gpg> save
- And don't forget tu publish your updated public key
- $ gpg --keyserver pgp.mit.edu --send-keys EAE1BF07
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement