I'd like to be able to log into and out of my ssh servers freely without entering a password. Previously, I did this with ssh-keygen, storing the key file under my ~/.ssh directory.

Since I also have an OpenPGP key, I thought it might be nice to have one less private key to keep track of, and use my OpenPGP key for SSH authentication. The documentation is sparse, but after a whole day of fussing with it, I've finally gotten it to work. It appears that a best practice is to create a separate authentication-only subkey for this purpose, so that's what I've done.

The authentication-only subkey can be protected with a password, in which case it's required upon login (which defeats the purpose, convenience-wise). In the interest of extreme convenience (and because my security needs are low atm), I'd like to do without the password altogether.

(I'm aware that gpg-agent can cache the password for a set amount of time, so that it's not required on subsequent logins, but the question remains:)

What are the theoretical security risks posed by using an authentication-only subkey with no password? Apart from the possibility that my private keys are stolen and someone could use them to log into my SSH servers (or anywhere else I have authorized it), is there any way that using a passwordless authentication-only subkey might compromise the security of my other subkeys, or the originating secret key?

  • The risks for unencrypted private key is primarily when you have stolen/lost the device. If you have full disk encryption on all machines where you have your unencrypted private key and strong desktop password, then one can argue that you'll be pretty much covered if your machine is stolen (apart from bugs in the desktop lock or fde implementation) – Lie Ryan Jun 30 '17 at 23:55
up vote 1 down vote accepted

Password-protection of OpenPGP keys means they are encrypted symmetrically with the passphrase used. Ass you already stated, this is especially helpful if the encrypted copy of the key is stolen.

Is there any way that using a passwordless authentication-only subkey might compromise the security of my other subkeys, or the originating secret key?

No. The authentication subkey can be used for exactly one specific operation: authentication. It is linked with the primary key by pairwise binding signatures (in the primary key's binding signature on the subkey, also the allowed key usage is configured). Especially, a subkey cannot be used to bind new subkeys to the primary key, only the primary key is allowed to perform this operation.

As all subkeys and also the primary key are cryptographically completely distinct keys, a broken/stolen subkey does not harm the others.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.