Copy rsa public key to remote server
Establish a secure connection via ssh
Last updated
Establish a secure connection via ssh
Last updated
This rsa public key displayed on your local computer also need to be copied to your remote computer to establish a secure connection via ssh. There are various methods to do so:
1) Copying Public Key Using ssh-copy-id
2) Copying Public Key Using SSH
3) Copying Public Key Manually
Windows PowerShell does not support all the commands. Methods 1 and 3 may not work on PowerShell but it will definitely work on Ubuntu. Here we will be using method 2 on PowerShell. For details on all the methods you can check the tutorial here.
So by method 2 use the following command on your local computer to copy the rsa public key to your remote computer:
Enter your username and remote server ip address on 'username@remote_host'. Here we use 'rocket@5.189.149.230'
You need to enter password of your remote server with user/login as 'rocket'.
Also you need to enter passphrase for the rsa public key on your local computer.
You are now logged in as user 'rocket' on your remote server
Now let's check the hidden files and folders with command:
.bash_history .bash_layout .bashrc .cache .local .profile .ssh .sudo_as_admin_successful
Now let's check contents of the folder .ssh :
authorized_keys
This is the same key as in you local computer 'rsa.pub'.