Header Ads

Generate GPG key on ubuntu 18.04

Generate GPG key on ubuntu 18.04


Generate GPG key on ubuntu 18.04


Make sure git installed in local workstation


1. Generate a GPG key pair


- if you are on version 2.1.17 or greater, use command


gpg --full-generate-key

- if you are not on 2.1.17 or greater, use command


gpg --default-new-key-algo rsa4096 --gen-key

2. Enter information
3. Accept  the default: RSA and RSA
4. Enter the desired key size. We recommend the maximum key size 4096
5. Select length of time the key should valid
6. Verify that selection
7. Enter your user information
8. Type a secure passphrase

- Check key GPG key has generate

gpg --list-secret-keys --keyid-format LONG

$ gpg --list-secret-keys --keyid-format LONG
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expiresCopy public key: : 2017-03-10]
uid                          Hubot 
ssb   4096R/42B317FD4BA89E7A 2016-03-10

- Get PGP public key


gpg --armor --export [GPG ID]

$ gpg --armor --export 3AA5C34371567BD2
# Prints the GPG key ID, in ASCII armor format

Copy public key: 


Copy your GPG key, beginning with -----BEGIN PGP PUBLIC KEY BLOCK----- and ending with -----END PGP PUBLIC KEY BLOCK-----.

Thanks


No comments