Unable to connect by ssh

  1. Describe the problem. Are there any error messages you can paste? Can you provide a screenshot of the problem (with sensitive information removed)?
    On trying to connect to a VM by ssh, I get the following error:

    ubuntu@ipaddress: Permission denied (publickey)

  2. What is the name of the VM or volume that the problem is affecting?

  3. Where is the VM or volume hosted; Birmingham, Cardiff, Swansea or Warwick?

  4. Is there any other information that you think might be helpful?
    I was trying to add a new public key to the ~/.ssh folder last night, so I could directly transfer data from a different computer. I copied this into the authorized_keys file, but suspect something has gone wrong, and is now preventing me from connecting at all, with the previous ssh key pair.

I’m hoping you are able to connect and help, as I don’t think I can fix this remotely without being able to connect.



Hi Jonathan, it looks like the public key that you are using to try and access the VM is not the same that you used to launch the VM. In order to access a VM you always need to use the same keypair (private and public) that you used to launch the VM.

Hi Lisa,
Thanks for the quick reply. So I left the public key that was used to launch the VM in place. And then tried to add a second to the authorized_keys file so I could access from a second machine. Or at least thought that’s what I’d done?

Is there a way to delete/reset this? Just I’m not able to delete the new entry in authorized_keys now that I can’t ssh into the VM.


Hi Jonathan,

I’m sorry you’re having difficulty accessing your VM.

SSH keys must be used in pairs (private, public). A private key must be used that has a corresponding public key on the VM in authorized_keys. https://www.ssh.com/academy/ssh/key has some more information.

If authorized_keys on the VM no longer has the corresponding public key for your private key, access is unfortunately lost and cannot be regained.

authorized_keys can have multiple keys in it, so if keys were just added you should be able to access the VM with one of the corresponding private keys.

Unfortunately we can’t restore access to VMs if you no longer have the required key. In this case, you should create a new VM and attach your data volumes to that.

Sorry I could not be of any more help.

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