0

How could i copy public key when ssh-copy-id is not available

Asked 2 months ago (Jan 17, 2021) in the field of Operating Systems by Criss

I am preparing to set up SSH keys on centos 8, but the ssh-copy-id is not available. How could i copy public key please?


Answers


0
Answered 2 months ago (Jan 17, 2021) by Eldernode staff

Dear Criss;
Do you have password-based SSH access to an account on your server? Make sure the ~/.sshdirectory exist and has the correct permissions. And use the following command:

 

cat ~/.ssh/id_rsa.pub | ssh [email protected]_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"  

 Feel free to ask your further probable questions or read a related article on: 

https://blog.eldernode.com/set-up-ssh-keys-on-centos-8/

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day