[suser@src.test.com]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/suser/.ssh/id_rsa): /home/suser/.ssh/id_rsa_test
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/suser/.ssh/id_rsa_test.
Your public key has been saved in /home/suser/.ssh/id_rsa_test.pub.
The key fingerprint is:
2d:66:09:56:c9:20:c0:04:64:0c:45:6b:08:59:69:93 suser@src.test.com
[suser@src.test.com.ssh]$

From the above command it below points are to be noted: Default location for public and private keys files are : user_home/.ssh/ dir Which is: /home/suser/.ssh dir . Default private key file name: id_rsa Default public key file name: id_rsa.pub

Since in my environment, files with these names were already present, a prompt as provided to overwrite the existing file or not. I have chosen not to overwrite the files and hence provided another name for the file.

Once the keys are generated, we need to copy the contents of the public key to the remote machine in file: user_home/ .ssh/authorized_keys In my env file name will be: /home/duser/ .ssh/authorized_keys