Once they agree to do this for you, you need to find a way to share public key so that they can copy the key on your behalf. If you do not have the access to the remote server at all, you can ask the team responsible for performing system administration related tasks on the server. After entering the password, your key will be copied, allowing you to log in without a password. You will be asked to supply the password for the remote account. On the remote side, you can ensure that the ~/.ssh directory exists, and then append the piped contents into the ~/.ssh/authorized_keys file: cat ~/.ssh/id_rsa.pub | ssh "mkdir -p ~/.ssh & cat > ~/.ssh/authorized_keys" For this, first you need to output the contents of the public key and pipe it into the ssh command. If you do not have the ssh-copy-id utility available, but still have password-based SSH access to the remote server, you can copy the contents of your public key in a different way. Once its done, you can login into remote machine using command: ssh without using ssh-copy-id utility After typing in the password, the contents of your public key will be appended to the end of the user account’s ~/.ssh/authorized_keys file: Once you run above command, it will ask you for the password associated with the current account. If this is not specified, it will look for the default file, ~/.ssh/id_rsa.pub. You can easily do this by running below command: ssh-copy-id -i ~/.ssh/rsa_lon_4096 can specify the file containing public key using the -i option. This utility makes it very simple to copy your ssh keys to the remote servers. ![]() Ssh-copy-id utility is included by default in many linux distributions. Below are some of the ways to copy the key. There are many ways to copy the public key generated to the remote machine. In this blog post, we are going to discuss the same. As we discussed previously, we need to copy the SSH public key to the remote server and few other connection options. Then we discussed how to generate an SSH Key pair. ![]() In the last blog post, we had overview of SSH protocol and how SSH authentication works. ![]() This is the second post in a series of blog posts on SSH.
0 Comments
Leave a Reply. |