Ssh "Permission Denied (publickey)" all of the sudden!

I’ve been using several instances for a while now, and just updated them this morning, but now when I try to log back in my passwords seem to not be working. As in they were working, then I updated the instance, logged back out, and now can’t log back in again, instead getting the publickey error. I haven’t changed the password or changed the ssh on my mac at all.

This is a group volume, hosted in Swansea. I’m running this on Mac OSX HighSierra 10.13.3

Any suggestions appreciated. Cheers

Are you using ssh keys to access these instances? None of them would be configured with password authentication by default.

Just to start with the easy stuff, please could you check your ssh keys and username combinations are correct (your instances would all use ubuntu as the default user) and also reboot any problematic instances using before trying again.

Using ssh -vvv to get verbose logging output might also help establish what the problem might be here.

Hi Matt
Yes, I’m using ssh keys for authentication, they’ve worked fine until today for some reason. It’s not actually giving me an option to enter the password any more, it’s just going straight to permission denied. I tried rebooting the instances, that hasn’t made a difference. I have the output of the -vvv should I send that across?


Could you drop it in a PM?

This problem is now fixed.

For the benefit of future visitors - this problem was caused by home directory permissions being too lax.

SSH authentication will fail (sensibly) for a number of reasons related to directory permissions. These include (most commonly):

  1. If anyone but the owner of the home directory has write permissions to the home directory
  2. If the owner of the home directory is not the user that is attempting to SSH to the VM
  3. If the /home/$USER/.ssh directory permissions are not 700
  4. If the /home/$USER/.ssh/authorized_keys file permissions are not 644

Please be careful when changing permissions as any mistakes won’t manifest immediately, only when you can’t access your instance!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.