The Problem
I recently installed Kubuntu 16.04.2 on my computer. Since then, I can no longer use my ssh keys to access bitbucket and github repositories. On the old system (Ubuntu 14.04) a pop-up with the title "Unlock private key" appeared for the first use of the key (asking for my passphrase) and I was set for the rest of the session.
Since the update I get the following error:
$ git pull
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
This is due to the fact that the key has not been added to the ssh-agent
(yet). I can do this manually using:
$ ssh-add ~/.ssh/my_key
Enter passphrase for .ssh/my_key:
which is a workaround.
Question
While the above workaround might do the trick and there are options to automate it (see link below), I would prefer to have the old functionality back where I am automatically queried for my passphrase at first use.
What could I (my system) be missing for this to work? I am not 100% about what parts/ programs are involved.
Additional Information
Not sure if this is relevant, but I am using LDAP, so I kept the content of my home folder when moving from Ubuntu 14.04 (with Unity) to 16.04 (with KDE).
For my email encryption keys, the behavior has not changed and I am asked for the passphrase via pop-up.
There is another question dealing with a similar problem. This however deals with a different version and has a different goal (They make it work on console, I would like my pop-up back).
As already said, add
to your
~/.ssh/config
to achieve similar behavior.The popup in older Ubuntu was coming from
gnome-keyring
, where you had your key stored. It is obviously not in the KDE version of Ubuntu.There is no simple way to get the same prompt from the pure OpenSSH. But you might try to experiment with KWallet, which might have similar functionality.
The default file names for the identity files are the following:
Add your own file to the
/etc/ssh/ssh_config
or renaming it should do the trick.I would be very surprised the ubuntu upgrade or version has anything to do with it.
it does sounds like a git+ssh problem. it could be unrelated, but I had a similar problem using git via ssh with bitbucket service.
what happened is that I had 2 bitbucket accounts. and both SSH keys loaded into my agent. bitbucket does not permit to reuse the same ssh key for multiple accounts. so you are forced to have two.
when both were loaded into my agent, I was logged into the wrong account and getting the same
Permission denied
error.I used
ssh-add -d
to temporary remove the identity from my agentthen I found out I could configure it in my ssh config properly.
then
have fun