I used to run Ubuntu 14.04 on my computer. Whenever I used ssh keys to log in to various servers, I used to get a GUI pop-up dialog asking me for the password for my key. After entering the password here once, it would usually remember it for the rest of my session. The pop-up dialog also had an option I could tick off to unlock the key at user login.

Now, after upgrading to Ubuntu 16.04, this functionality has disappeared. Now I just get prompted for the password for my ssh key on the command line every time I use it. This is annoying me beyond belief and I would like to reinstate the more automatic behaviour I was used to from 14.04.


It turns out that this is only happening for git when connecting to git -- in a specific git repository. I previously assumed this was an ssh issue since I am asked for a password to an ssh key. However, the above behaviour happens in one git repository with its remote on GitHub but not in another repository whose remote also resides on GitHub (under the same user account). This has led me to conclude that this must be a git configuration issue in one specific repository.

How can I configure how git asks ssh to use keys for login?

Update 2

After applying the solution https://unix.stackexchange.com/a/288368/44098, I now renamed the old repository copy to something else and renamed the new repository copy to the name of the old copy. This now causes the asking for password behaviour for the new repository copy instead. This leads me to conclude that the problem is caused by some ssh- or ssh-agent-related configuration somewhere containing the path to the repository. Any ideas?

1 Answer 1


I have not been able to identify the cause of this problem, but here is a solution:

Simply clone the repository to a new copy:

git clone old-repo new-repo
cd old-repo
git remote get-url origin  #  Copy this URL
cd ../new-repo
git remote set-url [paste URL from old-repo]

That is, I simple clone a new copy of the repository and give its 'origin' remote the same URL as that of the old repository. When pushing and pulling etc. in the new repository, ssh no longer asks for password and apparently uses my ssh key as I would like it to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .