Ssh Fido



Fido
Feitian ePass NFC

Ssh-keygen may be used to generate a FIDO token-backed SSH key, after which such keys may be used much like any other key type supported by OpenSSH, provided that the YubiKey is plugged in when the keys are used. YubiKeys require the user to explicitly authorize operations by touching or tapping them. One of the most exciting security enhancements in Ubuntu 20.04 LTS (Focal Fossa) is the ability to use the Fast Identity Online (FIDO) or Universal 2nd Factor (U2F) devices with SSH. By using a second authentication factor via a device, users can add another layer of security to their infrastructure through a stronger and yet still easy to use mechanism for authentication.

Feitian ePass NFC FIDO U2F Security Key can work as a Generic Identity Device Specification (GIDS) smart card. There are also many other manufacturers and card models to which these instructions can be applied, but the specific tools to initialize the card can be different.

In this how-to, we will prepare a USB/NFC hardware key for SSH authentication and register the device in WebADM. It is assumed you already have a working WebADM and Spankey servers, although you can also deploy the public key manually to a destination server.

Yubikey Ssh Fido2

For Yubikeys and other PIV devices, please refer to Smart Card -PIV

Ssh With Yubikey

1. Enabling CCID Mode

Feitian ePass keys can work in three different modes:

  • OATH HOTP (Event-based)

  • CCID (chip card interface device)

All these modes can be used with OpenOTP, but in this guide, we focus on the CCID which is useful for SSH authentication.

By default, the Feitian keys ship only have U2F/FIDO mode enabled, thus the first step is to change the operating mode of the key. This is done with a Feitian tool (ePassFIDO-NFC OTP Tool 3.7), which can be downloaded from Feitian website and which works in Windows.

Connect the key to a computer with the Feitian tool, start the tool and select an operating mode which includes CCID. The key can work simultaneously on all three modes. If the new mode includes U2F, you can continue to use the key for FIDO authentication simultaneously with SSH key authentication.

After the CCID mode is enabled, the smart card function must be initialized using other Feitian software (GIDS Initialization Tool). This tool can also be downloaded from the Feitian website.

Ssh Fido Account

Start the tool in windows, set the desired PIN and Admin key and click Initialize. Please take care in selecting and storing the PIN and Admin key.

2. Generating SSH Keys

Once the key is initialized, we can generate SSH keypair and extract the public key. For this, we need to connect it to a computer with OpenSC (version 0.18 or later).

First, we verify that the key is connected and recognized correctly:

Yubikey

Next we can dump the contents of the key:

Please note the ID number of the PIN, as this is used in the next command as –auth-id parameter, when we generate the public-private keypair:

Once the key pair is generated, we can list the contents of the device and extract the public key.

Ssh Fido Support

With this information we can create an inventory file in .csv format with the right public key. The serial number can be decided by you, as it is only used for keeping track of the devices in WebADM inventory. You can for example user the number printed on the physical device:

Next, we can import this file into the WebADM inventory, assign it to a user and test authentication with ssh.These steps are described in Smart Card -PIV starting at “We import the file. Under the import tab, we click on Import Inventory File:”

3. Using with a Contactless Reader

Ssh Fido2

The Feitian ePass key supports NFC communication. Thus, it is possible to use the GIDS smart card for authentication also with a contactless reader, resulting a very easy workflow:

U2f Security Key 2020

Or in SSH authorized key format, which can also be directly copied to the authorized_keys file in the destination server:

If you want to use the smart card authentication without providing the -I flag in the command line, you can configure OpenSC library in ~/.ssh/config (or to /etc/ssh/ssh_config for all users). The correct path the library depends on your system.

This manual was prepared with great care. However, RCDevs S.A. and the author cannot assume any legal or other liability for possible errors and their consequences. No responsibility is taken for the details contained in this manual. Subject to alternation without notice. RCDevs S.A. does not enter into any responsibility in this respect. The hardware and software described in this manual is provided on the basis of a license agreement. This manual is protected by copyright law. RCDevs S.A. reserves all rights, especially for translation into foreign languages. No part of this manual may be reproduced in any way (photocopies, microfilm or other methods) or transformed into machine-readable language without the prior written permission of RCDevs S.A. The latter especially applies for data processing systems. RCDevs S.A. also reserves all communication rights (lectures, radio and television). The hardware and software names mentioned in this manual are most often the registered trademarks of the respective manufacturers and as such are subject to the statutory regulations. Product and brand names are the property of RCDevs S.A. © 2021 RCDevs SA, All Rights Reserved