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
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/ 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.