Skip to main content

ssh Authorized Setup

If you want to run scripts from one server to the next or possibly a central server where you run clones and backups from you'll want to authorize the server on each of the servers you wan tto connect to.

First thing you need to do is generate a public and private key. Remember to keep the password black, I also use the defaults as you can see below.
ssh-keygen

Using ssh copy keys to target server or a shared directory like below that all the environments see
cp $HOME/.ssh/id_rsa.pub /nfs_share/tmp/id_rsa.pub

Check if the ssh directory exists on the target server, if not create it
mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys


Copy the public keys into the authorized_keys
cat /nfs_share/tmp/id_rsa.pub >> ~/.ssh/authorized_keys

Comments