Question

How to ssh from one droplet to another

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.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.