# YubiKey for SSH, Login, 2FA, GPG and Git Signing

DevFeed: [YubiKey for SSH, Login, 2FA, GPG and Git Signing](<https://devfeed.tech/articles/yubikey-for-ssh-login-2fa-gpg-and-git-signing-21150.md>)

Original publisher: [Read original article](<https://ocramius.github.io/blog/yubikey-for-ssh-gpg-git-and-local-login/>)

Published: 2017-04-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Marco Pivetta](<https://devfeed.tech/sources/marco-pivetta.md>)

Topics: [Security](<https://devfeed.tech/topics/security.md>), [OpenSSH](<https://devfeed.tech/topics/openssh.md>), [Authentication](<https://devfeed.tech/topics/authentication.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [USB](<https://devfeed.tech/topics/usb.md>), [Git](<https://devfeed.tech/topics/git.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [authentication](<https://devfeed.tech/tags/authentication.md>), [crypto](<https://devfeed.tech/tags/crypto.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [dell](<https://devfeed.tech/tags/dell.md>), [development](<https://devfeed.tech/tags/development.md>), [git](<https://devfeed.tech/tags/git.md>), [linux](<https://devfeed.tech/tags/linux.md>), [nfc](<https://devfeed.tech/tags/nfc.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pc](<https://devfeed.tech/tags/pc.md>), [ssh](<https://devfeed.tech/tags/ssh.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [usb](<https://devfeed.tech/tags/usb.md>), [xps](<https://devfeed.tech/tags/xps.md>)

## AI overview

A tutorial on using YubiKey Neo devices to improve developer security through two-factor authentication, PAM login authentication, GPG mail and Git commit signing or encryption, and SSH authentication. It also explains the need for a backup key and introduces NFC-based 2FA setup.

## Source excerpt

I've been using a YubiKey Neo for a bit over two years now, but its usage was limited to 2FA and U2F. Last week, I received my new DELL XPS 15 9560, and since I am maintaining some high impact open source projects, I wanted the setup to be well secured. In addition to that, I caught a bad flu, and that gave me enough excuses to waste time in figuring things out. In this article, I'm going to describe what I did, and how you can reproduce my setup for your own safety as well as the one of people that trust you. Yubi-WHAT? In first place, you should know that I am absolutely not a security expert: all I did was following the online tutorials that I found. I also am not a cryptography expert, and I am constantly dissatisfied with how the crypto community reduces everything into a TLA, making even the simplest things impossible to understand for mere mortals. First, let's clarify what a YubiKey is. That thing is a YubiKey. What does it do? It's basically an USB key filled with crypto features. It also is (currently) impossible to make a physical copy of it, and it is not possible to extract information written to it. It can: Generate HMAC hashes (kinda) Store GPG private keys Act as a keyboard that generates time-based passwords Generate 2FA time-based login codes What do we need? In order to follow this tutorial, you should have at least 2 (two) YubiKey Neo or equivalent devices. This means that you will have to spend approximately USD 100: these things are quite expensive. You absolutely need a backup key, because all these security measures may lock you out of your systems if you lose or damage one. Our kickass setup will allow us to do a series of cool things related to daily development operations: Two Factor Authentication PAM Authentication (logging into your linux/mac PC) GPG mail and GIT commit signing/encrypting SSH Authentication I am not going to describe the procedures in detail, but just link them and describe what we are doing, and why. Setting up NFC 2FA