I had my nitrokey setup for SSH and i worked on Ubuntu 17.04.
I recently upgraded to 17.10 and it still works for signing email, but it does not work for ssh anymore.
I searched for guides, but most are quite old and they seem to assume Ubuntu is still using upstart.
I am pretty sure I followed this guide previously:
However, since that assumes upstart, it is not applicable any more.
I have already tried quite a few things, but I seem unable to make it work.
Does anyone have a nice write up on how to do it?
Or else, we should probably work on a step by step guide for this.
mmm, my ssh still wants tu use password authentication.
Even though the key is already in authorized keys on the server. For some reason it seems to prefer password based authentication over key basedā¦
although I fixed that, because initially it did not have a slash between my home dir and .gnupg (I think that is an error in the instructions).
The directory exists, but no S.gpg-agent.ssh is there.
I did try again after invoking gpg2 --card-status but no luck.
it seems pretty difficult to put in a generic advice how to do this as this behaviour changed during different GnuPG versions and systems I tried to change that a bit now. Thanks for the hint!
Thatās fine. It will be created when gpg-agent is actually doing what it is supposed to for the first time
So, you made sure that āuse-agentā is in gpg.conf, āenable-ssh-supportā is in gpg-agent.conf and you could use pubkey auth for the server you like to ssh in before? Mhā¦
Did you try?
pkill gpg-agent; gpg2 --card-status; ssh ā¦
Mh, interesting. Would you mind creating a new user and following the instructions for this one? As I said I only tested with new accounts (as I did not use Ubuntu on regular basis). There is either something not running at all for your system or something old in the configs of your user disturbs. I would like to differentiate whatās the case hereā¦
EDIT: Just to be sure: you double checked the authorized_keys file with the output of āgpg2 --export-ssh-key [keyID]ā as well, did you?
EDIT2: Em⦠and do you have more than one private key in your gnupg-keyring and do you have an old id_rsa in your ~/.ssh? Maybe this can interfere as well.
This is for sure necessary! This meant when it says āThe Nitrokey should already have PGP keys installed and the local GnuPG keyring should know the keys.ā on the website. I expect the user to already have things configured to not make the instructions more complicated than necessaryā¦
Alright, I will have a look at my Ubuntu 17.10 then and try to find out what is wrong with your setup/my instruction
BTW: Are you using a special Desktop Environment? Or standard Unity/Gnome?
yeah, well, that was my fault. In trying to make the instructions as generic as possible
Your .bashrc should read:
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
This is probably ā/run/user/1000/gnupg/S.gpg-agent.sshā for your system/user. If you put this in Ubuntu 16.04 it wonāt work though, as the command āgpgconf --list-dirs agent-ssh-socketā gives out multiple folders instead of one. I tried to work around and thought the home-folder would work as well (as it was the standard in the past). Well, it isnāt. Sorry for the confusing and inconvenience!
I will try to find another (real) generic way instead. But you should be fine for now
Please let me know if it works (remember to open a new bash after changing .bashrc or just look at āecho $SSH_AUTH_SOCKā if it is fine).