Report this

What is the reason for this report?

How to ssh from one droplet to another

Posted on July 12, 2017

I’ve got 2 droplets and I have an idea to move files from a to b using rsync then return from b to a using the same. I need to use ssh in the rsync and getting a permission denied error. I also tried adding the ssh key but found you can’t add an ssh key to an existing droplet.

my ssh key works fine from my local machine I’d need it to work also from the droplet.



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are you sure the key on droplet a is authorized on dropblet b and vice-versa?

the key in ~/.ssh/id_rsa.pub on droplet a should appear as a line in ~/.ssh/authorized_keys on droplet b

Then, from droplet a, you should be able to type “ssh username@dropletb” and log in.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.