GitHub/gpg: Difference between revisions

From Omnia
Jump to navigation Jump to search
No edit summary
 
Line 28: Line 28:
     then enter empty password twice
     then enter empty password twice
     then save
     then save
Restart agent
==== Reset GPG Agent ====
Reset GPG agent: <ref>https://superuser.com/questions/1075404/how-can-i-restart-gpg-agent</ref>
gpgconf --kill gpg-agent
# or
gpg-connect-agent reloadagent /bye
systemctl --user status gpg-agent
systemctl --user stop gpg-agent
systemctl --user start gpg-agent
gpg-connect-agent /bye
# kill the agent
gpg-connect-agent killagent /bye
# start it again
gpg-connect-agent /bye


== keywords ==
== keywords ==

Latest revision as of 20:43, 23 July 2026

gpg

Adding a GPG key to your GitHub account - GitHub Docs
https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account

Generate key:

gpg --full-generate-key

List keys to get keyID

gpg --list-keys

Export public key by keyID, and save to Github

gpg --armor --export 3AA5C34371xxx

You will probably get an error about being unable to sign if you are in a remote console, to fix this: [1]

export GPG_TTY=$(tty)

Cache password in gpg-agent:

echo "" | gpg --clearsign
~/.bashrc
alias gpgpass="echo  | gpg --clearsign"

If you really hate security, you can remove the passphrase:

gpg --edit-key XXX
  passwd
   enter password to unlock
   then enter empty password twice
   then save

Restart agent

Reset GPG Agent

Reset GPG agent: [2]

gpgconf --kill gpg-agent
# or
gpg-connect-agent reloadagent /bye
systemctl --user status gpg-agent
systemctl --user stop gpg-agent
systemctl --user start gpg-agent
gpg-connect-agent /bye
# kill the agent
gpg-connect-agent killagent /bye
# start it again
gpg-connect-agent /bye

keywords