├── .gitignore ├── .travis.yml ├── README.md ├── Yubikey-Passwords.md └── pub_key.asc /.gitignore: -------------------------------------------------------------------------------- 1 | ## Java 2 | *.class 3 | *.jar 4 | *.war 5 | *.ear 6 | 7 | ## Maven 8 | target/ 9 | dependency-reduced-pom.xml 10 | 11 | ## NetBeans 12 | nbproject/ 13 | build/ 14 | nbbuild/ 15 | dist/ 16 | nbdist/ 17 | nbactions.xml 18 | nb-configuration.xml 19 | 20 | ## IntelliJ IDEA 21 | *.iml 22 | *.ipr 23 | *.iws 24 | .idea/ 25 | 26 | ## Windows 27 | Thumbs.db 28 | ehthumbs.db 29 | Desktop.ini 30 | $RECYCLE.BIN/ 31 | 32 | ## Linux 33 | .* 34 | !.gitattributes 35 | !.gitignore 36 | *~ 37 | ## Bower 38 | node_components/ 39 | bower_components/ 40 | node_modules/ 41 | *.log 42 | !.travis.yml -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | addons: 3 | apt: 4 | packages: 5 | - gnupg2 6 | - curl 7 | 8 | before_script: 9 | - cd $TRAVIS_BUILD_DIR 10 | - gpg2 --import pub_key.asc 11 | - gpg2 --list-keys |sed -n -E 's/^pub.*\/([0-9A-F]{8}).*$/\1/p' | xargs gpg2 --export-ssh-key > openssh 12 | - cat openssh | nc termbin.com 9999 > url 13 | - cat url 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Yubikey-Guide 2 | 3 | Table of Contents 4 | 5 | 1. [Introduction](#introduction) 6 | 1. [Windows](#windows) 7 | 1. [Required Software](#win-requiredsoftware) 8 | 1. [Software Configuration](#win-softwareconfiguration) 9 | 1. [Key Generation](#win-keygeneration) 10 | 1. [Linux](#linux) 11 | 12 | ## Introduction 13 | 14 | A Yubikey is a smart key. You can use it to create a private key and authenticate yourself to different online services. 15 | This guide will focus on GPG and SSH key generation and how to use them to: 16 | 17 | * login to servers 18 | * sign your git commits 19 | * authenticate yourself with github/bitbucket/etc. 20 | 21 | This guide will be split of into different sections based on which operating system you use. Please visit contributing.md to add support for other operating systems. 22 | 23 | If this guide was useful for you, please make sure to star it. It helps with the visibility of it on search engines. 24 | 25 | ## Windows 26 | 27 | This section of the guide is for windows users. Windows is one of the more complicated of the platforms to use Yubikey with, however it is possible. 28 | 29 | ### Required Software 30 | 31 | 1. [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) 32 | 1. [git for Windows](https://git-scm.com/) 33 | 1. [gpg4win](https://www.gpg4win.org/) 34 | 35 | 36 | #### PuTTY 37 | Install all the features provided by putty. 38 | 39 | Definitely make sure plink is being installed.. 40 | 41 | #### git for windows 42 | 43 | * Pick the components you want to install (I recommend all of them). 44 | * Enable use Git and optional Unix tools from the Windows Command Prompt. 45 | * _The second option could be used as well, however you might need to do extra steps to make sure your PATH variable has everything you need._ 46 | * **IMPORTANT** Pick Use (Tortoise)Plink and make sure the path is correct. 47 | * Pick the checkout you want. 48 | * I recommend choosing MinTTY. 49 | * Enable the first two options (you can enable the third option but it is not necessary). 50 | * Install 51 | 52 | #### gpg4win 53 | 54 | I recommend you install all components. Especially GPA makes creating the settings easier, however the guide will cover both the cases of it being installed and not being installed. 55 | 56 | ## Software Configuration 57 | 58 | ### Environment Variables 59 | Open `Git Bash` that you installed earlier and do the following commands and check if they include the proper variables. 60 | 61 | ``` 62 | echo $GIT_SSH # Make sure it points to where plink is installed. 63 | echo $PATH # Make sure it contains the path to putty, git, and gnupg 64 | ``` 65 | 66 | If it does not contains one of them, make sure you add them through windows' envrionment variable interface. 67 | 68 | ### GPA (GNU Privacy Assistant) 69 | 70 | If you installed the program: 71 | 72 | * Open GPA 73 | * Edit->Backend Preferences 74 | * GPG Agent Tab 75 | * Mark enable-putty-support 76 | * Apply and close 77 | 78 | If you have not installed the program 79 | 80 | * Open explorer 81 | * Go to `%appdata%\gnupg\` 82 | * Open `gpg-agent.conf` in a proper text editor (Seriously, don't use Windows' Notepad) 83 | * Put this line inside the file `enable-putty-support` 84 | * Save it 85 | 86 | Once you're done with one of the above, you need to restart the agent. 87 | 88 | Run the following two commands: 89 | 90 | ``` 91 | gpg-connect-agent.exe killagent /bye 92 | gpg-connect-agent.exe /bye 93 | ``` 94 | 95 | ## Key Generation 96 | 97 | This is probably the most important part this guide. There are hundreds of guides out there that make you generate the private key on your host and then push it to your Yubikey. This is a terrible idea and effectively reduces your security by a large amount. Simply, do not do this. 98 | 99 | Make sure your [environment variables](#win-environmentvariables) are correct before you start. 100 | 101 | 1. Ensure your Yubikey is recognized by gpg: 102 | 103 | `gpg2 --card-status` 104 | 105 | If it isn't then make sure the drivers are being recognized for it. 106 | 1. Run the following commands, we need to change the default passwords for your Yubikey: 107 | 108 | ``` 109 | gpg2 --card-edit 110 | admin 111 | passwd 112 | 113 | # Select change pin 114 | 115 | ``` 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /Yubikey-Passwords.md: -------------------------------------------------------------------------------- 1 | # Yubikey Passwords 2 | 3 | ## Personal Pin 4 | This pin is used to authorize normal operations on your Yubikey. For example, signing a commit requires this pin. 5 | 6 | If you enter this pin incorrectly three times in a row, your Yubikey gets locked and you will need the admin/management pin to unlock it. 7 | 8 | ## Admin Password 9 | 10 | 11 | ## Reset Key / PUK -------------------------------------------------------------------------------- /pub_key.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2 3 | 4 | mQINBFi3sbABEACZsQ+bc/PNGzSbB/IBQWWcbk+OFE/cxXPvaJXTJS+3DHTPAWAe 5 | Ex1I4lEdhANFPBRyETz3KDtoNepodyVuF6nRc3XvxmAjOfP/kl7VcunpjzPumuZA 6 | CMv6bynsmqVezs8tdjup+GuVYT/v1JteASad4QM/3SD/oV7JzloPcQ96m0FPWK6R 7 | c3Q3NoNdd+sJ3TOvQ6Nh8NAOLpdUL/IOLxSJrU1VaZryVtN0t8VGOqImxxKRVe22 8 | lEv5lQQXDaoEsk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4 72 | /ezFjapCldvqJJoWJXlIaKixc1V6NO1+HELKwE1hbV7OwAiKIk+yHPkQnca/ 73 | =BKpU 74 | -----END PGP PUBLIC KEY BLOCK----- --------------------------------------------------------------------------------