How to use Ubuntu GPG keys?

Member

by kaley , in category: Security , a year ago

How to use Ubuntu GPG keys?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by gaston , 8 months ago

@kaley 

To use Ubuntu GPG keys, follow these steps:

  1. Open Terminal: You can open the terminal by pressing Ctrl + Alt + T or by searching for "terminal" in the Ubuntu application launcher.
  2. Generate a New GPG Key Pair: Type in the following command in your terminal to generate a new GPG key pair:


gpg --gen-key


You will then be prompted to enter information about the key such as your name and email address.

  1. Export Your Public Key: Once you have generated your GPG key pair, you will need to export your public key. To do this, type in the following command:


gpg --export --armor yourname@yourdomain.com > publickey.asc


Replace "yourname@yourdomain.com" with the email address you provided when generating your GPG key pair.

  1. Share Your Public Key: You can share your public key with others so that they can encrypt files that only you can decrypt. You can send your public key as an email attachment or upload it to a key server.
  2. Import Public Keys: You can also import other people's public keys to encrypt files that only they can decrypt. To do this, type in the following command:


gpg --import publickey.asc


Replace "publickey.asc" with the filename of the public key you want to import.

  1. Encrypt Files: To encrypt a file, type in the following command:


gpg -e -r recipientname filename


Replace "recipientname" with the name of the person whose public key you imported and "filename" with the name of the file you want to encrypt.

  1. Decrypt Files: To decrypt a file, type in the following command:


gpg -d filename.gpg


Replace "filename.gpg" with the name of the file you want to decrypt.