Skip to content

Instantly share code, notes, and snippets.

@kofemann
Last active March 26, 2022 20:11
Show Gist options
  • Save kofemann/3e4417e3b93c81e6de08b02ab06e22d3 to your computer and use it in GitHub Desktop.
Save kofemann/3e4417e3b93c81e6de08b02ab06e22d3 to your computer and use it in GitHub Desktop.

dCache admin interface with YubiKeys

(by assuming you already have a yubikey ... )

pre-requisites

  • OpenSSH version 8.2 or later on the client
  • dCache 7.2 or later

Generate a new key pair

$ ssh-keygen -t ecdsa-sk -C <user@dcache>
Generating public/private ecdsa-sk key pair.
You may need to touch your authenticator to authorize key generation.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in id_ecdsa_sk
Your public key has been saved in id_ecdsa_sk.pub
The key fingerprint is:
SHA256:xxxx <user@dcache>
The key's randomart image is:
+-[ECDSA-SK 256]--+
|B= ..            |
|+ =..o           |
|o. +o+o o  o+o   |
|+ooo=o . . .==+  |
+----[SHA256]-----+

The option -t ecdsa-sk instructs OpenSSH to create an ECDSA key on a FIDO security key instead of a traditional private key file.

Add key to dCache

$ cat id_ecdsa_sk.pub >> /etc/dcache/admin/authorized_keys2

Connect to admin interface

On connect ssh client will ask you to touch the key:

$ ssh -p 22224 dcache-dev
Confirm user presence for key ECDSA-SK SHA256:xxx
User presence confirmed
dCache (7.2.2)
Type "\?" for help.

[dcache-dev] (local)> 

That's it!

Troubleshooting

(if you don't see Confirm user presence message)

if gnome keyring is used or ssh agent, then message is not shown, but key is activated (the led starts to flush and touch works). See solutions here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment