Difference between revisions of "Gpg"
Jump to navigation
Jump to search
(Created page with "# Simple password on file ``` gpg -c a.txt echo RELOADAGENT | gpg-connect-agent gpg -d a.txt ```") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | # Install | ||
+ | |||
+ | ## Ubuntu | ||
+ | ``` | ||
+ | sudo apt install gnupg2 | ||
+ | ``` | ||
+ | |||
+ | ## All | ||
+ | https://gnupg.org/download/index.html | ||
+ | |||
# Simple password on file | # Simple password on file | ||
``` | ``` | ||
Line 4: | Line 14: | ||
echo RELOADAGENT | gpg-connect-agent | echo RELOADAGENT | gpg-connect-agent | ||
gpg -d a.txt | gpg -d a.txt | ||
+ | ``` | ||
+ | |||
+ | # Common Commands | ||
+ | |||
+ | ## Create | ||
+ | ``` | ||
+ | gpg --full-generate-key --expert | ||
+ | ``` | ||
+ | |||
+ | ## Files Located | ||
+ | ``` | ||
+ | ~/.gnupg | ||
+ | ``` | ||
+ | |||
+ | ## List | ||
+ | ``` | ||
+ | gpg --list-secret-keys | ||
+ | gpg --list-keys | ||
+ | ``` | ||
+ | |||
+ | ## Delete | ||
+ | ``` | ||
+ | gpg --delete-key <id> | ||
+ | gpg --delete-secret-key <id> | ||
+ | ``` | ||
+ | |||
+ | # git | ||
+ | ``` | ||
+ | git config --global user.signingkey <id> | ||
+ | git config --global commit.gpgsign true | ||
+ | ``` | ||
+ | |||
+ | ## Sign | ||
+ | ``` | ||
+ | git commit -Ss -m "Add something" | ||
+ | ``` | ||
+ | |||
+ | ## Git signing errors in terminal | ||
+ | ### Error | ||
+ | ``` | ||
+ | error: gpg failed to sign the data | ||
+ | fatal: failed to write commit object | ||
+ | ``` | ||
+ | |||
+ | ### Do | ||
+ | ``` | ||
+ | export GPG_TTY=$(tty) | ||
``` | ``` |
Latest revision as of 19:09, 8 May 2024
Install
Ubuntu
sudo apt install gnupg2
All
https://gnupg.org/download/index.html
Simple password on file
gpg -c a.txt echo RELOADAGENT | gpg-connect-agent gpg -d a.txt
Common Commands
Create
gpg --full-generate-key --expert
Files Located
~/.gnupg
List
gpg --list-secret-keys gpg --list-keys
Delete
gpg --delete-key <id> gpg --delete-secret-key <id>
git
git config --global user.signingkey <id> git config --global commit.gpgsign true
Sign
git commit -Ss -m "Add something"
Git signing errors in terminal
Error
error: gpg failed to sign the data fatal: failed to write commit object
Do
export GPG_TTY=$(tty)