1. Source machine:
Copy the public key to the target machine
scp ~/.ssh/id_rsa.pub [email protected]:/home/test/.ssh
2. Directory machine:
Rename id_rsa.pub to authorized_keys file.
sudo mv id_rsa.pub authorized_keys
3. Directory machine to modify directory permissions:
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys
4. After performing these steps, you can log in to the Linux server on the source machine without a password: