I have public keys setup for droplet creation and i am able to remote into both droplets from my computer using the key pair but if I try to ssh from Droplet 1 to Droplet 2 it fails with the following info:
Apr 23 15:03:21 18 sshd[18270]: Connection closed by authenticating user root 127.0.0.1 port 38042 [preauth] Permission denied (publickey).
This happens on both droplets and even when connecting to localhost on the same Droplet.
UFW is disabled and sshd_config is set to the default that DO sets it to when it creates a droplet with a key file.
I have dug through everything i can find but i cannot get past this error.
Both droplets are using ubuntu 18.04
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Greetings!
This means that the server you are connecting to only accepts SSH key login, and the public key for your SSH key pair does not exist in /root/.ssh/authorized_keys no that other server. If going from Droplet1 to Droplet2, then Droplet2 needs to have the public key from Droplet1 in it’s authorized_keys file. The same goes for the other way around. Here you can find some documentation on creating SSH key pairs:
https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-openssh/
Jarland
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.