Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu 13.04, and recently changed my ssh keys. For some reason Unity, or something in Gnome (seahorse?) doesn't seem to be recognizing it. The keys were generated on a different machine, and I basically copied the new SSH key pair to /home/user/.ssh

Something broke after I copied the new keys over. When I run git clone <url> in a terminal in Unity, I get this error:

Agent admitted failure to sign using the key
Permission denied (publickey).
fatal: could not read from remote repository

Please make sure you have the correct access rights
and the repository exists

By chance, I switched to a tty console and ran the same git clone <url> command. It actually works! Is something in Unity is somehow managing the ssh keys, and somehow it isn't using the key pair in the /home/user/.ssh directory?

After some googling, I've tried running ssh-add but it doesn't work. I've also tried moving everything out of the /home/user/.local/share/keyrings directory then rebooting, but I'm still getting the same error in the terminal session in Unity.

What could be the issue here?

share|improve this question
    
Did you check file permissions and ownership? –  Manuel May 29 '13 at 6:29
    
Yes, id_rsa has permission 600, and id_rsa.pub has 664. I'm logged in as the owner in both the tty session and the Unity desktop session. –  peonicles May 29 '13 at 8:42

2 Answers 2

Gnome Keyring is managing the ssh keys in Unity by default.

auth.log shows this

gnome-keyring-daemon[1823]: no private keys found in file
gnome-keyring-daemon[1823]: invalid or unrecognized private SSH key: <email>
gnome-keyring-daemon[1823]: signing of the data failed: The operation failed
gnome-keyring-daemon[1823]: no private keys found in file
gnome-keyring-daemon[1823]: invalid or unrecognized private SSH key: <email>
gnome-keyring-daemon[1823]: signing of the data failed: The operation failed

A blog post here details how to disable Gnome Keyring in desktop sessions. I've listed the steps below.

Steps to disable Gnome Keyring in Unity :

1) "Unhide" the Gnome Keyring from Startup Applications by editting the /etc/xdg/autostart/gnome-keyring-ssh.desktop file and change "NoDisplay" to false.

2) Run "Startup Applications" via Dash, and uncheck Gnome Keyring. This will prevent Gnome Keyring from starting when Unity starts.

3) Log out, then log in again.

After the re-login, I'm able to run git clone <url> and git fetch successfully.

share|improve this answer

Seahorse is a GUI for gnome-keryring. You may find your ssh keys there.

SeaHorse is installed by default, just type Seahorse in dash.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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