Skip to content

Commit a4817ae

Browse files
committed
moved yubikey neo guide to jeykll
1 parent 1d96e93 commit a4817ae

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

security/yubikey-neo-opengpg.md renamed to website/_posts/2015-07-28-yubikey-neo-pgp.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Using YubiKey Neo for PGP keys on Debian
1+
---
2+
layout: post
3+
title: Using YubiKey Neo for PGP keys on Debian
4+
---
25
This guide assumes that you have already configured your Yubikey Neo as a smart card with your private keys and a pin. By the end of this guide you will have configured the machine to be able to use the Yubikey to decrypt and sign documents on your machine.
36

47
## Requirements
@@ -7,7 +10,7 @@ This guide assumes that you have already configured your Yubikey Neo as a smart
710
* Internet access (to install packages and download udev rules)
811

912
## Ensure gpg2 and scdaemon is installed
10-
``` bash
13+
<pre>
1114
$ su -c "apt-get install gpg2 scdaemon"
1215
$ gpg2 --version
1316
gpg (GnuPG) 2.0.26
@@ -24,28 +27,28 @@ Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
2427
CAMELLIA128, CAMELLIA192, CAMELLIA256
2528
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
2629
Compression: Uncompressed, ZIP, ZLIB, BZIP2
27-
```
30+
</pre>
2831

2932
## Disable seahorse from intercepting gpg stuff
3033
Stuff which starts on boot is stored in ```/etc/xdg/autostart```. We don't want gnome-keyring to be responsible for our gpg authentication because it can't deal with smart cards (which our yubikey neo is). After doing this you will need to log out and in again.
3134

32-
``` bash
35+
<pre>
3336
su -c "mv /etc/xdg/autostart/gnome-keyring-gpg.desktop /etc/xdg/autostart/gnome-keyring-gpg.desktop.disabled"
34-
```
37+
</pre>
3538

3639
## Ensure you have the udev rules for the yubikey
3740
Your card should now work as the root user, but in order to use your Yubikey as your standard user you will need to ensure that you have the neccary udev rules added to your system. The rules you need can be obtained from the Yubikey github account. You can also install the ```yubikey-personalization``` package on Debian based distributions.
3841

39-
``` bash
42+
<pre>
4043
# copy the udev rules to our downloads and then copy them (as root) to /etc/udev/rules.d to prevent wget being run as root
4144
wget https://raw.githubusercontent.com/Yubico/yubikey-personalization/master/69-yubikey.rules -P ~/Downloads/ && su -c "mv $HOME/Downloads/69-yubikey.rules /etc/udev/rules.d/"
4245
wget https://raw.githubusercontent.com/Yubico/yubikey-personalization/master/70-yubikey.rules -P ~/Downloads/ && su -c "mv $HOME/Downloads/70-yubikey.rules /etc/udev/rules.d/"
43-
```
46+
</pre>
4447

4548
## run gpg2 --card-status to check you can see your card
4649
I've removed most of the identifable infomation but the format should be the same. This should also create a key stub in your gpg keyring which tells gpg that in order to decrypt/sign documents using this key it will need to ask your yubikey.
4750

48-
``` bash
51+
<pre>
4952
webpigeon@desktop:~# gpg2 --card-status
5053
scdaemon[10004]: updating slot 0 status: 0x0000->0x0007 (0->1)
5154
Application ID ...: D2760001240102000006035077540000
@@ -69,20 +72,20 @@ Encryption key....: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
6972
Authentication key: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
7073
created ....: 0000-00-00 00:00:00
7174
General key info..: [none]
72-
```
75+
</pre>
7376

7477
## Check it worked
7578
In order to check that we can now use our smart card to decrypt things which have been encrypted for us, we can encrypt a test document then try to decrypt it. If everything worked as we expected you should be asked for your pin when you attempt to decrypt the file. Enter your pin when prompted. The encrypted text should now be decrypted and displayed on standard out.
7679

77-
``` bash
80+
<pre>
7881
echo "this is a test" | gpg2 --output test.gpg --encrypt --recipient [email protected]
7982
gpg2 --decrypt test.gpg
8083
scdaemon[2119]: updating slot 0 status: 0x0000->0x0007 (0->1)
8184
scdaemon[2119]: DBG: asking for PIN '||Please enter the PIN'
8285
gpg: encrypted with 2048-bit RSA key, ID 033F1F3D, created 2015-05-14
8386
"Joseph Walton-Rivers (WebPigeon) <[email protected]>"
8487
this is a test
85-
```
88+
</pre>
8689

8790
## Troubleshooting
8891
### selecting openpgp failed: Card error

0 commit comments

Comments
 (0)