Question

When copying the ssh key, what to copy in the authorized_keys file?

Posted October 6, 2019 744 views
Configuration Management Ansible

I am trying this out and I am sorry if this is a stupid question but do I copy this part of the key in to the authorized_keys file?

—–BEGIN RSA PRIVATE KEY—–

—–END RSA PRIVATE KEY—–

or Do I just copy the actual key in between those two pieces.

Thanks,
Michael

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

Hi @nexusguy59,

You need to copy your public key not your private one. The public key is located in the following file

cat ~/.ssh/id_rsa.pub

You need to copy it’s content and paste in your server’s ~/.ssh/authorized_keys file

Regards,
Kalin

Submit an Answer