GnuPG: Difference between revisions

936 bytes added ,  18 September 2020
→‎Troubleshooting: gpg-connect-agent RESET /bye
→‎Keyservers: add configuration
→‎Troubleshooting: gpg-connect-agent RESET /bye
 
(7 intermediate revisions by the same user not shown)
Line 56: Line 56:
Command> check
Command> check


// change passphrase
$ gpg --edit-key didi
Command> passwd
// save
Command> save


// encrypt [and compress] a document
// encrypt [and compress] a document
Line 82: Line 87:
$ gpg --verify doc.sig doc
$ gpg --verify doc.sig doc
</source>
</source>


== Key management ==
== Key management ==
Line 97: Line 101:
: update expiration time
: update expiration time


in order to import a private key on a different machine.
<source lang="console">
// export the key using an ASCII-armored format
$ gpg --export-secret-keys -a mhan@mhan.net > pkey.asc
// copy to a target machine, and then on the target machine
$ gpg --import pkey.asc
</source>
Note: if key already existed, you may need to delete 'em via '''--delete-keys''' or '''--delete-secret-keys'''


== Key distribution ==
== Key distribution ==
Line 116: Line 132:
</source>
</source>


= Troubleshooting =
Kill any running agents
<source lang="console">
$ gpgconf --kill gpg-agent
</source>
Reset agent as a user
<source lang="console">
$ gpg-connect-agent RESET /bye
</source>
If you get ''Inappropriate ioctl for device'' you can add '''export GPG_TTY=$(tty)''' to either ~/.bashrc or ~/.profile (or ~/.bash_profile).


= Keyservers =
= Keyservers =
Line 128: Line 161:


* http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/
* http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/
* [https://eligible.com/blog/commit-signing-with-git-hub-keybase-and-gpg/ Commit Signing With Git, Hub, Keybase, and GPG]