GPG
2020/06/29 by jean tran
Install GPG
Generate a GPG Key
Run the following command:
gpg --full-gen-keyA prompt ask you to choose between 1-4 key type:
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1It is recommended to choose at least
4096:
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bitsSpecify GPG key expiration:
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 0
Key does not expire at allAsking for confirmation (y/N):
Double checking your info to validate or edit:
Listing GPG Keys:
It will prompt information such as the following:
Export public key ID
Copy the value equivalent of BC4F4B77228120E9 (replace your key ID as listed on step6)
Signing git commits
Add the ID to your Git configuration file
configor.gitconfig(example:BC4F4B77228120E9):
Commit can be signed by adding the following
-Sflag
Case if you don't want to bother with
-Sflag
Tips & Tricks
For OSX add the following command on your .<type>rc file. (.bashrc | .zshrc)
Last updated
Was this helpful?