I am writing a tutorial on setting up Ceph the hard way, shell all the way.
I am not happy with the number of ssh commands it takes to connect to a remote host as root, create new user, then scp keys over… there must be a smarter, simpler way – especially on Ubuntu.
Here is the exact problem:
local user FOO that has access to remote server with user ROOT needs to setup keys (and possibly the user as well) for user CEPH. Repeat n times with n remote hosts.
Any clever one-liners I am missing?
scp -i digitalocean id_rsa.pub storage-1:/root ssh -i digitalocean storage-1 useradd ceph mkdir ~ceph/.ssh cat id_rsa.pub >> ~ceph/.ssh/authorized_keys chmod 700 ~ceph/.ssh chmod 600 ~ceph/.ssh/authorized_keys chown ceph:ceph ~ceph/.ssh/authorized_keys chown ceph:ceph ~ceph/.ssh/ rm id_rsa.pub