Generate Pgp Public Key Ubuntu

Posted on  by
Generate Pgp Public Key Ubuntu 5,8/10 8535 reviews

Jun 30, 2018 Create Your Public/Private Key Pair and Revocation Certificate. Use gpg -full-gen-key command to generate your key pair. Gpg -full-gen-key. It asks you what kind of key you want. Notice there’re four options. The default is to create a RSA public/private key pair and also a RSA signing key. Let’s hit Enter to select the default. Before you begin, decide if you want to generate the private key on the YubiKey device, or if you want to generate the private key off of the YubiKey and then move the subkeys to the YubiKey. To allow for your PGP keys to be backed up, we recommend you generate them on. Creating a private/public key pair on Ubuntu Last updated: 04 Jun 2012. There are many reasons you might want to create a key pair on Linux, more specifically on Ubuntu. For more information about key pairs, see this. If your server is an Amazon EC2 Server Instance, you might want to. Apr 04, 2017 The output will be redirected to mypubkey.gpg file which has the content of the public key to provide for communication. Submit your public keys to a keyserver. Once you have this ASCII-armored public key, you can manually paste it into a form at a public key server like pgp.mit.edu.

I was trying to install docker on my Ubuntu server as an initial step to set up a continuous integration server for my Python project. As I was following through the guide provided by docker, the following command:

gave me the following error:

I did a ping afterwards and affirmed that my server was not able to reach the key server at p80.pool.sks-keyservers.net.

How do pgp keys work

Since I was not able to add the PGP public key of docker's apt repository, I was not able to continue with the apt-get update command further down the guide.

Looking for the PGP public key of docker's apt repository server at p80.pool.sks-keyservers.net

Since I was not able to get the PGP public key automatically with the apt-key command inside my Ubuntu server, I thought about trying to add the key manually on my Ubuntu server.

I first tried to use my browser on my Windows machine to access the url specified by the --keyserver flag of the apt-key command. With that, I got to know that there is a web server running at p80.pool.sks-keyservers.net.

My browser returned me a web page with a search box and two buttons - 'Search Key' and 'Submit Key'. Since I wanted to get the contents of the public PGP key of docker's apt repository, I typed 'docker' into the search box, hit the 'Search Key' button and was returned with a list of PGP public keys. And since I had indicated 58118E89F3A912897C070ADBF76221572C52609D via the --recv-keys flag in the apt-key command, I get my browser to find the section that contains the string '5811'.

Generate Pgp Key Ubuntu

Indeed, there were some results and my browser highlighted the portion containing the '5811'. I click on the first link in the section that contains 'Fingerprint=5811 8E89 F3A9 1289 7C07 0ADB F762 2157 2C52 609D' and was returned with a page that displays the PGP public key that I was looking for.

Creating a physical file of the public PGP key

/csr-and-private-key-generator.html. I then proceeded to create a physical file in my Ubuntu server via the vi editor. Note that the display page contains text that was irrelevant for the apt-key command. The PGP public key consists of only the following chunk:

After I saved the file on my Ubuntu server as 58118E89F3A912897C070ADBF76221572C52609D.key in my current working directory, I proceeded to add it into the APT key store on my Ubuntu server.

The command to manually add the public PGP key of docker's apt repository at Ubuntu's Advanced Packaging Tool key store

With everything in place, I ran the following command:

The command returns the string 'OK' and I was able to continue with the installation of docker-engine on my Ubuntu server.

About Clivant

Clivant a.k.a Chai Heng enjoys composing software and building systems to serve people. He owns techcoil.com and hopes that whatever he had written and built so far had benefited people. All views expressed belongs to him and are not representative of the company that he works/worked for.

← Previous post
How to save and load environment objects in R
Next post →
Ensuring docker can run properly behind your HTTP proxy on Ubuntu 14.0.4

GNU gpg is encryption and signing tool.

The GNU Privacy Guard (GnuPG or GPG) is a free software replacement for the PGP suite of cryptographic software.

GnuPG encrypts messages using asymmetric keypairs individually generated by GnuPG users. The resulting public keys can be exchanged with other users in a variety of ways, such as Internet key servers. They must always be exchanged carefully to prevent identity spoofing by corrupting public key ↔ ‘owner’ identity correspondences. It is also possible to add a cryptographic digital signature to a message, so the message integrity and sender can be verified, if a particular correspondence relied upon has not been corrupted.

How do I create my own GnuPG private and public key

1) Login to your shell account

2) Use gpg command to create the keys
$ gpg --gen-key
Output:

How To Create A Pgp Public Key

3) Now keys generated, you can list your own key using:
$ gpg -K
OR
$ gpg --list-keys
Output:

Let us try to understand the line pub 1024D/CA7A8402 2007-02-10:

  • pub : Public key
  • 1024D : The number of bits in the key
  • CA7A8402 : The key ID
  • 2007-02-10 : The date of key creation
  • Vivek Gite : The user real name
  • <vivek@nixcraftcorp.com> : The email id

Most important is the key ID i.e. CA7A8402. Make sure you use powerful passphrase to protect keys and not the easy one.

4) To list secret key, type the command:
$ gpg --list-secret-keys
Output:

What Is A Pgp Public Key

ADVERTISEMENTS