How to ssh from one droplet to another

July 12, 2017 1.5k views
Linux Commands Ubuntu 16.04

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.

1 Answer

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/authorizedkeys on droplet b

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

  • I’ve copied the key to the second server, when I try to ssh from server a to b I get a permission denied (public key).

Have another answer? Share your knowledge.