Yubico / developers.yubico.com

Source code for generating our website
https://developers.yubico.com
53 stars 64 forks source link

Document how to use yubihsm with openssh #113

Closed blaufish closed 3 weeks ago

blaufish commented 6 years ago

Perhaps you could test and document how to use OpenSSH with YubiHSM?

These are my current steps, mostly derived from https://access.redhat.com/articles/1523343 but with a number of changes:

Go2Device commented 5 years ago

Hello Blaufish, from where you get the _yubihsmpkcs11.so module? I install on Ubuntu 18.04.1 LTS from the Yubico PPA yubikey-piv-manager, but didn't find this module on my machine. After installing gnutls-bin i able to use opensc-pkcs11.so:

ubuntu@ubuntu:~$ pkcs11-tool --list-slots --module=/usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so Available slots: Slot 0 (0x0): Yubico Yubikey 4 OTP+U2F+CCID 00 00 token label : PIV Card Holder pin (PIV_II) token manufacturer : piv_II token model : PKCS#15 emulated token flags : login required, rng, token initialized, PIN initialized hardware version : 0.0 firmware version : 0.0 serial num : XXXXXXXXXX(removed) pin min/max : 4/8 Slot 1 (0x4): Broadcom Corp 5880 [Contacted SmartCard] (0123456789ABCD) 01 00 (empty)

blaufish commented 5 years ago

@Go2Device this issue was about YubiHSM (2), not Yubikey.

Yubikey and other PKCS#11 modules based on wrapping a PIV applet seems to be what OpenSSH is developed and tested against. So most simple USB sticks and smartcards with a PIV applet is expected to work with OpenSSH. Mosts HSMs and other fully fledged provider are not expected to work (well) with OpenSSH.

OpenSSH without patches (at least in March when I tested this) have two issues;

joostd commented 3 weeks ago

Thank you @blaufish for the suggestion, and apologies for leaving this issue open for so long. I am now closing it however, as I don't think a YubiHSM is typically used for securing user access to SSH servers. It may very well be used as a CA for SSH certificates, or for storing server keys, and this can be achieved through the PKCS#11 module distributed via our YubiHSM SDK.