In: Computer Science
130 Submit
Copy your public key which is in ~/.ssh/id_rsa.pub to the remote machine by completing this command:
scp ~/.ssh/id_rsa.pub [email protected]:_____/_____
To do this we have to manually append the content of your id_rsa.pub file to the /root/.ssh/authorized_keys file on your Destination machine. If you are going to copy the key to root user the location will be
/root/.ssh/authorized_keys .
From the Step 1 : you may have seen the below line
Your public key has been saved in
/root/.ssh/id_rsa.pub.
This says the public key which you need to copy to the remote server is located in the above file. So you need to copy the content of this file and then copy or paste them in the authorized_keys of the remote server
So do the below steps
Below command will give you the key to be copied:
Login to Remote server to which you need to copy this above key and make sure you use the same user to which you need to copy the ssh key. If you need direct root access, copy the key directly to /root/.ssh/ section
Create a folder .ssh if it does not exist
To check if that exists and if not create it using the below commands: