At times, for example if a server has a script that needs to copy a file to a client via SSH, it will be good if the server can SSH to the client without using the password. This is achieved by copying the content of server’s SSH public key available in “/<user’s home folder>/.ssh/id_rsa.pub” to the end of the authorized_keys file in the client located at “/<user’s home folder>/.ssh/known_hosts”
- This can be achieved by using the following command in the server “ssh-keygen” and selecting the default options.
- On the server node, go to “/<user’s home folder>/.ssh/” and type the command ” ssh-copy-id user@<client node IP>“
- Test ssh connection, and see if you can access the client without a password