Setting up key based authentication

If you are going to be using Clara Cloud Storage as part of your backup strategy, it isn’t practical to require a password to be manually entered every time you want to run a backup. While some utilities can handle credential management for you, the easiest thing to do is generally to create a keypair and upload the public part of the key to your filesystem.

First, generate an SSH keypair if you don’t already have one;

ssh-keygen -t rsa -b 4096

Accept the defaults, so that the private and public keys end up in the home directory. Don’t enter a passphrase, just press enter at each prompt to skip.

Next, upload your newly created public key;

scp ~/.ssh/ [email protected]:.ssh/authorized_keys

Finally, test the key based authentication;

ssh [email protected] "ls"

The command should complete without asking for your account password.

In some cases, you may need to allow multiple systems to access the same filesystem. You can have multiple public keys listed at once.

For the first system, follow the instructions above.
For the second and every subsequent system, replace the “scp” step with this;

cat ~/.ssh/ | ssh [email protected] "dd of=.ssh/authorized_keys oflag=append conv=notrunc"