When I connect to my VPS (16.04) with SSH, the connection is denied and the following error is displayed :

Agent admitted failure to sign using the key.
Permission denied (publickey).

To connect, I have to enter the following command to make it work (my computer is on ubuntu 15.04) :


How do I not enter this command each time ? Is there a patch ?

  • Please use ssh -vvv yourIPserver will display more info to debug. <br/> Anyway, remember chmod your .ssh folder to 700 and private key(ex:id_rsa) to 600 – Ha Noi Dec 16 '16 at 10:08
  • 1
    It's the first time I hear about this issue... Google yields some interesting things, such as this one: chrisjean.com/… – fkraiem Dec 16 '16 at 10:12
  • And by the way, 15.04 is EOL, so questions regarding it are off topic. – fkraiem Dec 16 '16 at 10:13
  • Wait, this qurstion is tagged 16.04, so which one is it? – fkraiem Dec 16 '16 at 10:15
  • The rights to folders and files are correct. I have updated the question. – Mathieu Dec 16 '16 at 10:34

You are using ssh-agent (or some derivative like gnome-keyring), which is storing your ssh keys. They might got removed, modified or somehow inaccessible during the time.

  • check what keys are in ssh-agent using ssh-add -l. Do they exists?
  • are you using gnome-keyring? How does your $SSH_AUTH_SOCK look like? See echo $SSH_AUTH_SOCK. Then open "Passwords and keys" application and check the keys there (and remove the problematic ones).
  • restart should take care of this problem too.

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