How to add RSA key to authorized_keys file?

Raji A C picture Raji A C · Sep 12, 2012 · Viewed 167k times · Source

I've created an RSA public key and I want to add that to authorized_keys file, but there is no such file in my Ubuntu 11.10 machine.

How can I add the key to authorized_keys?

Answer

donden1 picture donden1 · Jan 21, 2014

Make sure when executing Michael Krelin's solution you do the following

cat <your_public_key_file> >> ~/.ssh/authorized_keys

Note the double > without the double > the existing contents of authorized_keys will be over-written (nuked!) and that may not be desirable