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
?
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
?
I know I am replying too late but for anyone else who needs this, run following command from your local machine
this has worked perfectly fine. All you need to do is just to replace
with your own user for that particular host
To overwrite authorized_keys
To append to the end of authorized_keys
Make sure when executing Michael Krelin's solution you do the following
Note the double
>
without the double>
the existing contents of authorized_keys will be over-written (nuked!) and that may not be desirableThere is already a command in the ssh suite to do this automatically for you. I.e log into a remote host and add the public key to that computers authorized_keys file.
If the key you are installing is
~/.ssh/id_rsa
then you can even drop the-i
flag completely.Much better than manually doing it!