Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. # GPG Cheat Sheet
  2.  
  3. ## Change expiration date of a key
  4.  
  5. $ gpg --list-secret-keys
  6. sec 4096R/EAE1BF07 2013-07-04 [expires: 2017-07-05]
  7. uid Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
  8. uid Charles-Henri Bruyand <chbruyand@mayhem.fr>
  9. ssb 4096R/B92D1CF4 2013-07-04
  10.  
  11. Edit the key
  12.  
  13. $ gpg --edit-key EAE1BF07
  14.  
  15. List the key and subkeys
  16.  
  17. gpg> list
  18.  
  19. pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2017-07-05 usage: SC
  20. trust: ultimate validity: ultimate
  21. sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
  22. [ultimate] (1). Charles-Henri Bruyand <chbruyand@mayhem.fr>
  23. [ultimate] (2) Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
  24.  
  25. Select the primary key
  26.  
  27. gpg> key 0
  28.  
  29. pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2017-07-05 usage: SC
  30. trust: ultimate validity: ultimate
  31. sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
  32. [ultimate] (1). Charles-Henri Bruyand <chbruyand@mayhem.fr>
  33. [ultimate] (2) Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
  34.  
  35. Use the `expire` command to update the expiration date
  36.  
  37. ```
  38. gpg> expire
  39. Changing expiration time for the primary key.
  40. gpg: WARNING: no user ID has been marked as primary. This command may
  41. cause a different user ID to become the assumed primary.
  42. Please specify how long the key should be valid.
  43. 0 = key does not expire
  44. <n> = key expires in n days
  45. <n>w = key expires in n weeks
  46. <n>m = key expires in n months
  47. <n>y = key expires in n years
  48. Key is valid for? (0) 1y
  49. Key expires at Thu Jun 21 11:39:25 2018 CEST
  50. Is this correct? (y/N) y
  51.  
  52. You need a passphrase to unlock the secret key for
  53. user: "Charles-Henri Bruyand <chbruyand@mayhem.fr>"
  54. 4096-bit RSA key, ID EAE1BF07, created 2013-07-04
  55.  
  56.  
  57. pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2018-06-21 usage: SC
  58. trust: ultimate validity: ultimate
  59. sub 4096R/B92D1CF4 created: 2013-07-04 expires: 2017-07-05 usage: E
  60. [ultimate] (1) Charles-Henri Bruyand <chbruyand@mayhem.fr>
  61. [ultimate] (2). Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
  62. ```
  63.  
  64. Repeat the operation to edit subkeys using the `key` command to select them by index
  65.  
  66. ```
  67. gpg> expire
  68. Changing expiration time for a subkey.
  69. Please specify how long the key should be valid.
  70. 0 = key does not expire
  71. <n> = key expires in n days
  72. <n>w = key expires in n weeks
  73. <n>m = key expires in n months
  74. <n>y = key expires in n years
  75. Key is valid for? (0) 1y
  76. Key expires at Thu Jun 21 11:41:31 2018 CEST
  77. Is this correct? (y/N) y
  78.  
  79. You need a passphrase to unlock the secret key for
  80. user: "Charles-Henri Bruyand <chbruyand@mayhem.fr>"
  81. 4096-bit RSA key, ID EAE1BF07, created 2013-07-04
  82.  
  83.  
  84. pub 4096R/EAE1BF07 created: 2013-07-04 expires: 2018-06-21 usage: SC
  85. trust: ultimate validity: ultimate
  86. sub* 4096R/B92D1CF4 created: 2013-07-04 expires: 2018-06-21 usage: E
  87. [ultimate] (1)* Charles-Henri Bruyand <chbruyand@mayhem.fr>
  88. [ultimate] (2). Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
  89. ```
  90.  
  91. Save your changes
  92.  
  93. gpg> save
  94.  
  95. And don't forget tu publish your updated public key
  96.  
  97. $ gpg --keyserver pgp.mit.edu --send-keys EAE1BF07
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement