You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/_posts/2015-07-28-yubikey-neo-pgp.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
+
---
2
5
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.
3
6
4
7
## Requirements
@@ -7,7 +10,7 @@ This guide assumes that you have already configured your Yubikey Neo as a smart
7
10
* Internet access (to install packages and download udev rules)
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.
31
34
32
-
```bash
35
+
<pre>
33
36
su -c "mv /etc/xdg/autostart/gnome-keyring-gpg.desktop /etc/xdg/autostart/gnome-keyring-gpg.desktop.disabled"
34
-
```
37
+
</pre>
35
38
36
39
## Ensure you have the udev rules for the yubikey
37
40
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.
38
41
39
-
```bash
42
+
<pre>
40
43
# 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
41
44
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/"
42
45
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>
44
47
45
48
## run gpg2 --card-status to check you can see your card
46
49
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.
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.
76
79
77
-
```bash
80
+
<pre>
78
81
echo "this is a test" | gpg2 --output test.gpg --encrypt --recipient [email protected]
0 commit comments