Permission Denied (publickey)
SSH stops with:
root@203.0.113.10: Permission denied (publickey).The server only accepts SSH keys and none of the keys your computer offered match. Work through these causes in order.
The key was added after the server was created
Section titled “The key was added after the server was created”Only new servers receive workspace keys. If you added the key later, run “Sync SSH Keys” on the instance. Read more in SSH Keys.
A sync removed a key you added by hand
Section titled “A sync removed a key you added by hand”“Sync SSH Keys” replaces root’s keys with the workspace keys. Add the missing key to your workspace and sync again.
Wrong username
Section titled “Wrong username”Workspace keys are installed for root only. To log in as another user, copy the keys to that user as shown in Creating a Sudo User.
Your computer offers the wrong key
Section titled “Your computer offers the wrong key”Point SSH at the key you added:
ssh -i ~/.ssh/id_ed25519 root@203.0.113.10In Bitvise, check that “Initial method” is “publickey” and the right “Client key” is selected.
Finding the cause
Section titled “Finding the cause”Run SSH with -v to see which keys it offers and how the server answers:
ssh -v root@203.0.113.10Look for Offering public key lines. If your key is not in the list, SSH cannot find it. Use -i. If it is offered and rejected, the server does not have that public key.
Getting back in
Section titled “Getting back in”If no key works, use the dashboard terminal:
- Head over to the instance list in our panel and open your instance
- Open the “Terminal” tab
- Log in as
root - Add your public key to
/root/.ssh/authorized_keys, or fix one of the causes above
If you do not know the root password, hit “Reset Password” in the instance’s “Advanced” menu. Read more in Terminal.