0

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

Asked 3 years 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 3 years 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 username@remote_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: 

Tutorial 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

+8595670151

7 days a week, 24 hours a day