for-azure icon indicating copy to clipboard operation
for-azure copied to clipboard

Adding SSH key to authorized_keys

Open davidwneary opened this issue 6 years ago • 2 comments

Hi,

I want to add another ssh key to the authorized keys of each of the nodes in my swarm so a colleague can also ssh into the swarm - is there a way to do this without logging into each node in turn?

I thought something like this might do the trick:

swarm-exec docker run -v /home/docker/.ssh:/docker-ssh bash bash -c  "echo \"<PUBLIC SSH KEY>\" >> /docker-ssh/authorized_keys"

but the file remained unchanged. I tested this on my local machine and it had the correct effect but not on the swarm

Sorry if this isn't the correct place to ask this, let me know if I should ask elsewhere.

Cheers Dave

davidwneary avatar Sep 23 '17 15:09 davidwneary