Using your YubiKey - CivicActions Guidebook (2024)

Notes on installing and setting up your YubiKey for various platforms and applications.

Introduction

The YubiKey is a hardware device manufactured by Yubico that provides a hardware, phishing resistant "second factor" enabling true multi-factor authentication: something you know (your password) and something you have (your YubiKey). It enables you to easily and securely log in to accounts by emitting one-time passwords or using a FIDO-based public/private key pair generated by the device.

Operation

  • Simply plug it into an unused USB port.
  • During certain types of authentication you will be prompted on screen to press the inset copper button marked with and (often lit) "Y".

Security Hints

  • If you trust your environment (like at home) you can keep the YubiKey near or even plugged into your computer.
  • In low trust environments (coffee shops, hotel rooms, etc.) keep your YubiKey with you at all times (in a pocket or purse), especially if step away from your computer, even briefly. If your computer is compromised, it won't be accessible without the YubiKey that you have on you.
  • Do not use SMS text messages for multi-factor authentication. Your MFA is only as strong as the weakest method you have configured.

Enable YubiKey MFA for applications

See "Let's get your YubiKey to work" (from Yubico) on how to use MFA with: Gmail, LastPass, GitHub and many other services.

See also: How to Secure Your Google, Dropbox, and GitHub Accounts With a Yubikey

LastPass

This requires a YubiKey token (cover the button for approximately one second) on laptop/desktop to unlock LastPass.

  • My Vault -> Account Settings -> Multifactor Options
  • Set up one free option (e.g., Google Authenticator or LastPass Authenticator) - this is a useful backup
  • YubiKey (an easier option) is available when using LastPass Premium ($12/year)
    • Select the YubiKey option.
    • Insert the YubiKey device into a USB port on your computer.
    • Focus your cursor on the "YubiKey #1" field.
    • Press the button on the YubiKey device.
    • A long string of dots should appear in the YubiKey #1 field.
    • Change the "YubiKey Authentication" status to "Enabled"
    • Set "Enabled" ==> "Yes"
    • Set "Permit Offline Access" ==> "Disallow"
    • Press the Update button
    • Enter your LastPass master password and press Confirm.
    • YubiKey is now enabled for your LastPass account.
  • If your phone supports NFC, you can touch the more recent Yubikeys against your phone to unlock on mobile.

Google

For each Google account you have:

  • Visit https://accounts.google.com/b/0/SmsAuthSettings#devices
  • Enable TFA, and complete the phone verification process (phone will act as backup TFA).
  • Click on "Security Keys" and follow instructions to add YubiKey.
  • Return to the main page and add a second phone and/or print backup codes.
  • As long as you have a backup, you can also install the YubiKey Authenticator app, and configure your account to use that for the backup TFA instead of SMS/phone - this is the same as the Google Authenticator app, except that it stores the credentials on your YubiKey instead of the phone.
  • If you have funky devices/apps that don't support TFA, you can set an application specific password using that tab. This includes sending E-mail from your personal Gmail account using your civicactions.com IMAP, for instance.

GitHub

AWS Root Account

For each AWS account you have:

AWS IAM Account

Up to 8 different MFA devices can be assigned, with a combination of Yubikeys, hardware TOTP tokens and authenticator apps.

  • Visit https://console.aws.amazon.com/iam/home?region=us-east-1#users
  • Choose your user name
  • Select the "Security Credentials" tab
  • Under Multi-factor Authentication(MFA), select "Assign MFA device"
  • Enter a Device Name and Select "Security Key"
  • Allow your browser access to your Yubikey, if prompted
  • Enter your Yubikey's pin, if prompted
  • Touch your Yubikey when instructed

Linux

Locking your Machine with YubiKey

This will require the YubiKey (Two Factor Authentication) to be inserted to authenticate via PAM (login, sudo or screen unlock). Test this carefully in an alternate console session to ensure you don't lock yourself out! (If you do get locked out, you'll have to boot with a live CD and undo the changes in /etc/pam.d/. As this requires a reboot, your encrypted disk will require its passphrase again, which is the key to security here.)

This is required of CivicActions "privileged users" such as System Administrators, and it is our intention that it be standard practice for all CivicActions employees and contractors.

Installing the Yubico libpam module

In order to connect your YubiKey to the screen locking software on your computer, you need to:

Arch yubico-pam setup
pacaur -S yubico-pam
Fedora Yubico libpam module
Ubuntu/Xubuntu Yubico libpam module
sudo apt-get install libpam-yubico
Set up PAM MFA on Linux

PAM is the Pluggable Authentication Module used by GNU/Linux and Mac OS X to manage login authentication.

See Yubico GitHub page for complete documentation.

ykpamcfg -2 -v

Ubuntu autoconfiguration during installation of libpam-yubico may already have placed a line like the following in either /etc/pam.d/common-auth or /etc/pam.d/system-auth. If not using Ubuntu (or the line is not there), edit /etc/pam.d/system-auth (will need to sudo) and add the following line at the top of the file:

auth required pam_yubico.so mode=challenge-response
Linux YubiKey removal lock

For additional security, you may want to immediately lock the screen when the YubiKey is removed.

This locks the laptop immediately when any YubiKey is removed. If you are not using xautolock as your "away detector", replace xautolock with a command to trigger your screen lock with the "away detector" that you do use. This is inspired by https://vtluug.org/wiki/Yubikey#Automatic_Screen_Locking_.28i3lock.2C_slock.2C_etc..29

As your login user, create executable file ~/bin/ykgone:

#!/bin/bashUSER=$(stat -c "%U" "$0")if usb-devices | fgrep Vendor=1050; then echo "YubiKey present"else echo "YubiKey not present, locking" export DISPLAY=":0" export XAUTHORITY=/home/$USER/.Xauthority su $USER -c "xautolock -locknow" &fi

Next, create (with sudo) a device notification file /etc/udev/rules.d/90-yubikey.rules:

ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="/home/$USER/bin/ykgone"

Personalize your YubiKey on Linux

This allows you to use your YubiKey with Google MFA (new fangled U2F), as well as LastPass (which uses the OTP application).

neoman# Enable OTP, U2F, CCID checkboxes if needed, follow instructions to add and remove keyykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible

Mac OS X

This is the Mac OS X specific documentation for YubiKey.

Please help make this page more useful by adding links you found useful (describe exactly how they are useful) and specific steps you used to install, configure, and test your YubiKey.

Mac OSX YubiKey tool

This should be straightforward, but waiting for a pull request that clearly explains how to:

  • Enable OTP, U2F & CCID
  • Personalize Configuration Slot 2 with options:
    • chal-resp (Set challenge-response mode)
    • chal-hmac (Generate HMAC-SHA1 challenge responses)
    • hmac-lt64 (Calculate HMAC on less than 64 bytes input)
    • serial-api-visible (Allow serial number to be read using an API call)

Install apps

See:

tbd...

Set up PAM MFA on MacOS

tbd...

Screen lock on lid close or idle

tbd...

Away detection ideas

Exceptions to the "idle timeout lock" can be made if you are on your home network and feel that it is secure. Adapt the below script if you only want to lock your screen when you are away from home.

Assuming ~/bin/ is in your $PATH, and you want to see if a file is on a Windows server, create executable file ~/bin/out-lock:

#!/bin/shMOUNT="$HOME/mountain"# Checks if server is mountedif [ ! -d "$MOUNT" ]then SERVER_IP="192.168.1.1" SHARE_NAME="share" USERNAME="admin" PASSWORD="password" FILE="home.txt" mount_smbfs //$USERNAME:$PASSWORD@$SERVER_IP/$SHARE_NAME $MOUNTficontents=$(cat $MOUNT/$FILE)hash=`echo -n $contents | shasum -a 256`cuthash=`echo $hash | cut -c1-64`if [ "$cuthash" != "7147a8f255f49cb7693dcd19b6b46e139680d48a03e0a075ea237deb7e6bacc9" ]then # Lock Screen /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspendfi

The "cron" or launchctl file located at $HOME/Library/LaunchAgents/com.dan.outlock.plist might look like this to run every 15 minutes:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>Label</key> <string>com.dan.outlock</string> <key>ProgramArguments</key> <array> <string>/bin/out-lock</string> </array> <key>Nice</key> <integer>1</integer> <key>StartInterval</key> <integer>900</integer> <key>RunAtLoad</key> <true/></dict></plist>

MacOS YubiKey removal lock

tbd...

This page was lastupdated on May 6, 2024.

Using your YubiKey - CivicActions Guidebook (2024)

FAQs

How do I use my YubiKey for personal use? ›

On a computer, insert the YubiKey into a USB-port and touch the YubiKey to verify you are human and not a remote hacker.

How do I use my YubiKey for the first time? ›

How to set up your YubiKey
  1. Plug in your YubiKey.
  2. Go to Yubico.com/setup and click your device.
  3. In the Compatible accounts and services section, browse the list of supported apps and services, and select the ones you want to secure with your device.
  4. Your selection will appear in a list next to the available apps.
Nov 27, 2023

Should I keep my YubiKey plugged in? ›

Do I need to keep my yubikey plugged in all the time? A. No, you only need to insert your yubikey when you are prompted to do so during login. Leaving it plugged in could result in the yubikey being lost or damaged.

Can I use YubiKey for all my passwords? ›

The YubiKey works with Password Safe to protect your passwords using two-factor authentication (2FA). Both a master password and a YubiKey are needed to enable access to your Password Safe file, which contains the usernames, websites, passwords and other information for all of your online accounts.

Should you carry your YubiKey with you? ›

There are a couple of ways around this, but the fundamental best practice is to have multiple copies of your YubiKey. You should have at least one backup key at home while you are traveling. We'd recommend keeping a second copy secure at home, ideally in a lockbox or safe of some kind.

What happens when I touch my YubiKey? ›

The act of tapping and holding an NFC-enabled YubiKey to the NFC reader on a mobile device takes the place of touching the gold contact to generate an OTP.

What is the best use of YubiKey? ›

One of the best uses for a YubiKey is to replace your regular authenticator apps. Most two-factor authentication codes for websites and apps use a technology known as TOTP, or Time-Based One-Time password. This is the four or six-digit code generated by your authentication app when you log in to an app or website.

How do I know if my YubiKey is working? ›

Testing the Credential
  1. Insert the YubiKey into the computer.
  2. Click the Yubico OTP button. The following screen, "Test your YubiKey with Yubico OTP" shows the cursor blinking in the Yubico OTP field.
  3. Tap the metal button or contact on the YubiKey. The OTP appears in the Yubico OTP field. ...
  4. Click Validate.
May 7, 2020

Do you tap or insert your YubiKey? ›

You can simply insert the key into the port on your device, press the button on the hardware, and you should be granted access if you are an authorized user of the account or device. With an NFC-enabled device, you can tap the YubiKey against the phone to complete authentication.

What is the lifespan of a YubiKey? ›

A Yubikey will essentially last forever, and if you stay clear of the insanity that is Passkeys its Webauthn element can support an infinite number of websites.

Does YubiKey work without Internet? ›

Unlike SMS codes and mobile push authentication, YubiKeys do not require a cellular connection to operate. In fact, they don't even require batteries or have any other external dependency. Simply plug the key into a USB port on your device and touch to authenticate.

What happens if someone steals my YubiKey? ›

So, what happens if you lose your YubiKey? In that case, you can still use your Authenticator app (phew!). While you can't create a backup YubiKey, you can always contact Yubico to get a replacement key.

Is YubiKey obsolete? ›

It's possible that YubiKey may become less necessary as passwordless login options become more widely available, but it's unlikely that it will become completely obsolete. Passwordless login options such as biometric authentication and security keys can offer a more secure and convenient way to access accounts.

What are the risks of YubiKey? ›

The theft scenario is indeed disturbing because if the thief learns your PIN and then steals the Yubikey, you're facing severe problems: the thief can easily check all your passkeys, get access to your accounts, remove all the passkeys and register only the stolen Yubikey, change the password, remove any other 2FA ...

How many passkeys can a YubiKey hold? ›

The YubiKey works as a passkey generator that can create both the public and private keys necessary to begin passkey login with accounts, apps, services and vendors that enable it – a YubiKey serves as a repository for up to 100 unique passkeys.

Which YubiKey for personal use? ›

If you're interested in using a YubiKey on mobile, we recommend using the YubiKey 5 Series, specifically the YubiKey 5 NFC, YubiKey 5C NFC or the YubiKey 5Ci. For FIDO only usage, it is also possible to use a Security Key Series device.

How do I use my spare YubiKey? ›

Registering a spare key is exactly the same process as registering your primary key. Please visit yubico.com/setup for information on how to register your YubiKeys. Once you identify the specific YubiKey you'd like to set up, select the services you want to register your YubiKey with and simply follow the instructions.

How do I extract my private key from YubiKey? ›

The owner is responsible for keeping the private key secret. Owners can secure private keys with the YubiKey by importing them or, better yet, generating the private key directly on the YubiKey. Private keys cannot be exported or extracted from the YubiKey.

How do I use my YubiKey on my phone? ›

Open the app and hold the key up to the NFC adapter, or if you're using a YubiKey 5Ci, connect the key to your phone via Lightning. Open the site where you want to set up two-factor authentication on another device (for example, a laptop or PC).

Top Articles
What Is ITBM? IT Business Management Explained
How Efficient Are Solar Panels? Top Brands Compared in 2024
Star Wars Mongol Heleer
Netronline Taxes
Warren Ohio Craigslist
Roblox Roguelike
Time in Baltimore, Maryland, United States now
Citibank Branch Locations In Orlando Florida
How to know if a financial advisor is good?
Tyrunt
BULLETIN OF ANIMAL HEALTH AND PRODUCTION IN AFRICA
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
Kostenlose Games: Die besten Free to play Spiele 2024 - Update mit einem legendären Shooter
Mlifeinsider Okta
True Statement About A Crown Dependency Crossword
Transformers Movie Wiki
Our Facility
Oscar Nominated Brings Winning Profile to the Kentucky Turf Cup
Sand Castle Parents Guide
Most McDonald's by Country 2024
Google Feud Unblocked 6969
Hellraiser III [1996] [R] - 5.8.6 | Parents' Guide & Review | Kids-In-Mind.com
Spoilers: Impact 1000 Taping Results For 9/14/2023 - PWMania - Wrestling News
Vrachtwagens in Nederland kopen - gebruikt en nieuw - TrucksNL
Walmart Car Department Phone Number
Aol News Weather Entertainment Local Lifestyle
8005607994
Play It Again Sports Norman Photos
Redfin Skagit County
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Does Hunter Schafer Have A Dick
Scripchat Gratis
55Th And Kedzie Elite Staffing
Churchill Downs Racing Entries
Garden Grove Classlink
Bend Missed Connections
404-459-1280
M3Gan Showtimes Near Cinemark North Hills And Xd
What Are Digital Kitchens & How Can They Work for Foodservice
The Land Book 9 Release Date 2023
The Boogeyman Showtimes Near Surf Cinemas
How are you feeling? Vocabulary & expressions to answer this common question!
1v1.LOL Game [Unblocked] | Play Online
My Locker Ausd
Lovely Nails Prices (2024) – Salon Rates
Alston – Travel guide at Wikivoyage
RubberDucks Front Office
DL381 Delta Air Lines Estado de vuelo Hoy y Historial 2024 | Trip.com
Sams Gas Price San Angelo
Publix Store 840
Bob Wright Yukon Accident
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 6276

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.