Section2

Setting up a GPG key and assign your GPG key to your Launchpad account is one of things we tend do only once! duanedesign has kindly found some notes for this. If you get stuck, please head over to their IRC channel at #ubuntu-beginners and one of the people there will be happy to help out.

Classroom Session 2

Registering your Launch Pad address

Please head over to register.

Create your GPG

1. Open terminal and enter the command:

gpg --gen-key

2. This will lead to a selection screen with the following options:

  • 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)

3. Select (1), which will enable both encryption and signing.

A keysize of 2048 (which is the default) is a good choice.

4. Key is valid for? (0) Most people make their keys valid until infinity, which is the default option. (You will want to create a revocation certificate later here is the link http://bit.uz/lEp)

5. Hit Y and proceed.

6. You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form:

Real name: Dennis Kaarsemaker Email address: dennis@kaarsemaker.net Comment: Tutorial key You selected this USER-ID:

Make sure that the name on the key is not a pseudonym, and that it matches the name in your passport, or other government issued photo-identification! You can add extra e-mail addresses to the key later.

7. Type O to create your key.

8. You need a Passphrase to protect your secret key.

You will be asked for your passphrase twice. Make sure to enter a strong passphrase. DO NOT FORGET THIS IT WILL RENDER KEY USELESS. You would then need to revoke it, that is what the revocation certificate is for we mentioned earlier. We will not get into how to create one in this guide, the link to accomplish this i included above.

9. After you type your passphrase twice, the key will be generated. Please follow the instructions on the screen till you reach a screen similar to the one below.

  • gpg: key D8FC66D2 marked as ultimately trusted public and secret key created and signed. pub 1024D/D8FC66D2 2005-09-08
    • Key fingerprint = 95BD 8377 2644 DD4F 28B5 2C37 0F6E 4CA6 D8FC 66D2

    uid Dennis Kaarsemaker (Tutorial key) <dennis@kaarsemaker.net> sub 2048g/389AA63E 2005-09-08

The key-id is D8FC66D2 <---yours will be different

10. It is probably a good idea to set this key as default in your .bashrc. Doing this will allow applications using GPG to automatically use your key.

Set your key as the default key by entering this line in your ~/.bashrc. You can do this by typing in the Terminal <your favorite editor> ~.bashrc Place this at the bottom somewhere.

  • export GPGKEY=D8FC66D2 <---yours will be different

11. I also recommend you upload your PUBLIC, not private key, to a keyserver so that anyone can download it. Once you have uploaded it to one keyserver, it will propagate to the other keyservers Use this command:

gpg --send-keys --keyserver keyserver.ubuntu.com D8FC66D2 <--yours will be different

Adding your GPG key to your Launchpad account

1. Log onto your Launchpad account, then click on the yellow icon to the right of OpenPGP keys.

Paste your key fingerprint into the textbox. To get your fingerprint run the following command in terminal:

gpg --fingerprint

The key fingerprint would be something like:

95BD 8377 2644 DD4F 28B5 2C37 0F6E 4CA6 D8FC 66D2 <


yours will be different

2. Now paste your key fingerprint into the textbox on the launchpad OpenPGP Keys page

3. Launchpad will send you an email which you will have to decrypt. You can save the text to a file. In our example we will name it text.file and save it in your Home directory. Be sure not to alter the message as you paste it to your test.file document. Also remove any trailing whitespace.


BEGIN PGP MESSAGE


  • Version: GnuPG v1.4.3 (GNU/Linux) hQIOA0THhKozD+K5EAf9F3PcOL2iU6onH2YsvB6IKDXNxbK0NBVy6ppxcNq8hoTe cuHvzWLFfh1ehhSNe1V6xpuFnt5sJoeA4qEEOxez3HmY80tKIKMPLyhC/8JiSIW9 fwuxj4C0F6pdyrpvGbQAzfPEFk/P1AtIHXm4WLXduhBT7YEpmUk/I4A/KlSrKoiP J5vBtbroUyp2jvIhDUmY7ToU+ifrDe3+VP1ZzSEJzOOXec9oPbcbvf5NptXA7Hbp S0ElBAcLjKpAu7VKotCwFZIsVXDHT/mxf2qm88bGIrlXS5uTzvmyhQps1KmyNiCz I0i5kSVvHZWyVZ+8FrROLqYAqqnEIMg9hUnbFAervgf/YiYs0xxWLYf9e14eoMZA ranGT72q/JHmBNBYenOijaquFNi1TH5J8Udtt2RfdyRUlmGilxRvtIYL8gpnuNpS +GHOoBWUN2f4nawaDeqgrf6Nt3qQWWLO4iJPgieejFP2FP6zkLme1t7dXo+z1ary EZuxSLtKIWkOFEZ8Gcn02hBgOhJZucnkF6BmVW9dr1C4QEAmGM631uqfsp5PapAn yjHbEU1L2R9i7vPtJNRr6ubFLWg1Yhfv63ByxSx/WQHMMqlrbL+moXBGED3L2hM8 7FP9eapBRgmS+Bda9ArcGMUElTOkWoUYIOPyLOYmo15LvbxHOVaXjn7+fDgr2S1J R9LArwHycmdKKelRww+ZvylHIfq8xy10atRQIYawchh9A1myXD1TlWbrrIkodQJF iEpO2i1LKvqwZHOx3szT4hF+44tNFzQIL1j+zF5Hrt2WOTnS5WXGgGRtfEd8F7fN khQZOAdhwrnlY+yknruC8Y8Jm8vM57+KnPgBfvxuxzLX1XFTfTZCHXeUmwwu3mga m+6WzckeBGBDHKK6GqwFoOAykTwjyqOZaty7DPHeoINc0tLMVr9Ks64DScf8bgh4 MkNonA0YhMQbkmwRc33APw441+/iLw5gqndQdX44kKqC71dG6LqanAOjD29Xj3JV ZBsjg95Jrx7Sx+i/V0PUeaU9QjCT0Q1jEy1Bcs8NYtTJnpG+4oHYJ0pyiGxIquQH V9E+hW6Qehx5DbsIXEvfeaBBHOfAHHOhUH14WK4bsJWm8wZ50XiYBZrNFOqzsm13 2STcY4VIoJp3Uw2qNyvZXQUhpndlfgQGO14CMSadzDn6Vts= =hTe6

END PGP MESSAGE


4. We named our file file.txt and saved it in the Home directory so the command to decrypt it would be:

gpg --decrypt ~/file.txt

5. You will need to enter your passphrase.

6. The message will be displayed along with the link you must follow to confirm your key in Launchpad. Follow the link, enter your Launchpad password as asked, and you are done!

Testing/Activities/Classroom/Section2 (last edited 2013-02-04 17:12:17 by host-89-242-218-249)