User Tools

Site Tools


gnupg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gnupg [2022/07/19 20:52] – created 85.134.209.200gnupg [2022/10/21 23:47] (current) admin
Line 3: Line 3:
 =====GNUPG HOW-TO===== =====GNUPG HOW-TO=====
 Run the following from a linux based operating system (e.g. debian) and accept the defaults. Run the following from a linux based operating system (e.g. debian) and accept the defaults.
-<br>Note, it may take some time to generate the random information.+ 
 +Note, it may take some time to generate the random information. 
 +<code>
  gpg --gen-key  gpg --gen-key
 +</code>
  
 To see all the keys - yours and your friends etc.: To see all the keys - yours and your friends etc.:
 +<code>
  gpg --list-keys  gpg --list-keys
 +</code>
  
 Example of above: Example of above:
 +<code>
  /home/you/.gnupg/pubring.gpg  /home/you/.gnupg/pubring.gpg
  ----------------------------  ----------------------------
Line 19: Line 25:
  pub = Public Key  pub = Public Key
  Public Key ID (UID) = 32j38dk2  Public Key ID (UID) = 32j38dk2
 +</code>
  
 To send your key (public) to a person: To send your key (public) to a person:
 +<code>
  -o is for a file name (steve)  -o is for a file name (steve)
  -a is for an ascii file  -a is for an ascii file
  gpg --export -o steve -a UID  gpg --export -o steve -a UID
 +</code>
  
 To import a key manually from someone: To import a key manually from someone:
 +<code>
  gpg --import filename  gpg --import filename
 +</code>
  
 Upload Public Key to key server: Upload Public Key to key server:
 +<code>
  gpg --send-keys --keyserver wwwkeys.pgp.net UID  gpg --send-keys --keyserver wwwkeys.pgp.net UID
 +</code>
  
 To edit keys - Typically used for signing keys To edit keys - Typically used for signing keys
-<br>(cant change name or comment, only password and expiry) +<code> 
-<br>UID = See example above+(cant change name or comment, only password and expiry) 
 +#UID = See example above 
  gpg --edit-key UID  gpg --edit-key UID
 +</code>
  
 To Search for Keys: To Search for Keys:
-<br>(This Will also allow you to download and include the person)+ 
 +(This Will also allow you to download and include the person) 
 +<code>
  gpg --search-key --keyserver wwwkeys.pgp.net stephen burke  gpg --search-key --keyserver wwwkeys.pgp.net stephen burke
 +</code>
  
 To Create a gpg fingerprint so you can PRINT out your Key fingerprint: To Create a gpg fingerprint so you can PRINT out your Key fingerprint:
-<br>This allows you to take away to a "Key Signing Party" and sign other keys verifying the person's identity using two forms of id.+This allows you to take away to a "Key Signing Party" and sign other keys verifying the person's identity using two forms of id. 
 +<code>
  gpg --fingerprint  gpg --fingerprint
 +</code>
  
 ==== Add User ID ==== ==== Add User ID ====
 Adding in a User ID: Adding in a User ID:
 +<code>
  gpg --edit-key UID  gpg --edit-key UID
- uid n  <nowiki>//</nowiki>Toggles selection of user id with index n. Use 0 to deselect all. + uid n      #Toggles selection of user id with index n. Use 0 to deselect all. 
  list  list
 See the * beside the Current User id. After current ID is selected type: See the * beside the Current User id. After current ID is selected type:
  primary  primary
 +</code>
 That should be it. Upload keys with command above. That should be it. Upload keys with command above.
  
 ==== KeySigning Procedure ==== ==== KeySigning Procedure ====
 See original: http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/KeySigning See original: http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/KeySigning
 +<code>
  gpg --search-key --keyserver wwwkeys.eu.pgp.net firstname lastname  gpg --search-key --keyserver wwwkeys.eu.pgp.net firstname lastname
  #Send a signed and encrypted email, asking for a signed reply. When a signed reply is obtained, then:  #Send a signed and encrypted email, asking for a signed reply. When a signed reply is obtained, then:
  gpg --ask-cert-level --sign-key UID  gpg --ask-cert-level --sign-key UID
  gpg --send-key UID  gpg --send-key UID
 +</code>
 ---- ----
-URL's:<br> +URL's: 
-http://webber.dewinter.com/gnupg_howto/english/GPGMiniHowto.html<br> +  http://webber.dewinter.com/gnupg_howto/english/GPGMiniHowto.html<br> 
-http://www.gnome.org/projects/evolution/doc/x1700.html<br> +  http://www.gnome.org/projects/evolution/doc/x1700.html<br> 
-http://www.nmlug.org/faqs/gen-gpg-key.html+  http://www.nmlug.org/faqs/gen-gpg-key.html
  
 ===== Extend GPG Expiry ===== ===== Extend GPG Expiry =====
Line 70: Line 94:
  
 There is a great guide at: http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/ There is a great guide at: http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/
 +<code>
 Some of the main points: Some of the main points:
  gpg --list-keys  gpg --list-keys
Line 76: Line 100:
  {type} key 0  {type} key 0
  expire  expire
- <nowiki>//</nowiki>enter new expiry date+ #enter new expiry date
  {type} key 1  {type} key 1
- <nowiki>//</nowiki>enter new expiry date+ #enter new expiry date
  save  save
  gpg --keyserver pgp.mit.edu --send-keys UID  gpg --keyserver pgp.mit.edu --send-keys UID
 +</code>
  
 ===== Fixes ===== ===== Fixes =====
 ==== public key decryption failed: Inappropriate ioctl for device ==== ==== public key decryption failed: Inappropriate ioctl for device ====
 After updates using gpg via pine threw up the error: gpg: public key decryption failed: Inappropriate ioctl for device After updates using gpg via pine threw up the error: gpg: public key decryption failed: Inappropriate ioctl for device
-The solution:+The solution is to edit /home/user/.bashrc and add: 
 +<code>
  export GPG_TTY=$(tty)  export GPG_TTY=$(tty)
 +</code>
 Kudos to: https://zaplanincan.wordpress.com/tag/decryption-failed/ Kudos to: https://zaplanincan.wordpress.com/tag/decryption-failed/
gnupg.1658260370.txt.gz · Last modified: 2022/07/19 21:13 (external edit)