4 ms·
Does anyone have a guide on how to store an SSH key on it? I only found PGP key guides (and I have my key on it), but not much for SSH. I also think it doesn't
by StavrosK 10y ago
Does anyone have a guide on how to store an SSH key on it? I only found PGP key guides (and I have my key on it), but not much for SSH. I also think it doesn't do ECC...
- pfg 10y agoYou can use the GPG key on the device for SSH authentication through gpg-agent. Here's their documentation[1] for this feature. ECC keys should work, but haven't tried that (I use RSA-4096). [1]: https://developers.yubico.com/PGP/SSH_authentication/ https://developers.yubico.com/PGP/SSH_authentication/
- StavrosK 10y agoThank you, I seem to recall trying gpg-agent but I'm not sure I went anywhere with it. Will try again.
- amitshah 10y agoThere's this very nice guide that works well for Linux machines: https://github.com/lfit/ssh-gpg-smartcard-config/blob/master/YubiKey_NEO.rst https://github.com/lfit/ssh-gpg-smartcard-config/blob/master...
- StavrosK 10y agoI'll give that a shot, thank you!
- nickik 10y agoYes. You have to check out the PIV module. It can even be used as a CA. https://developers.yubico.com/PIV/Guides/ https://developers.yubico.com/PIV/Guides/ There are a number of tools you can install yubico-piv-manager/yubico-piv-tool but check the guides. I had some problems with this, somehow I could not add the key to ssh-agent, but that was related to the ssh-agent, not sure its a general problem. Note, this does only support 2k keys. If you use the GPG Smartcard and a Authentication Subkey you can get 4k keys. The advantage of PIV is that you can actually use ssh-agent and you don't have to use gpg-agent. Gpg-agent does not have all the features that ssh-agent does, and for me that was relevant. I prefer to keep the two separate anyways.
- StavrosK 10y agoThank you, this is the best guide I've seen so far. It's much simpler to install and use. However, like you, I'm having some problems. Adding the key to the ssh-agent asks for a PKCS password and always comes back with "agent refused cooperation". I also can't log in to a host that has that SSH key, but maybe that's because I have too many keys loaded... EDIT: Never mind, it works perfectly, thanks!
- nickik 10y agoThis is the issue I had. I can access the key directly from the file but not add it. How did you solve it?
- StavrosK 10y agoThis is a whole post, but basically, there are multiple SSH agents. ssh-agent supports the card and ed25519 keys, but doesn't support persisting keys across reboots. Gnome keyring supports persisting keys, but no card or ed25519 (AFAIK). gpg-agent supports persisting keys and ed25519, but no card. Unfortunately, there's no perfect solution, so I just added an alias "yubissh" to include the library in the command line :(