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

October 6, 2019 43 views
Ansible Configuration Management

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

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

Have another answer? Share your knowledge.