Note: User directory on different should not be same. Such as pprftp home directory on dmspar01 is /homecomm/pprftp, on dmspar02 is /home/pprftp.
ssh/sftp from dmspar01 to dmspar02 without password
- On dmspar01:
- Login by pprftp
- cd /homecomm/pprftp/.ssh
- Create the key on dmspar01:
i. ssh-keygen –t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/homecomm/sxia/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /homecomm/sxia/.ssh/id_dsa.
Your public key has been saved in /homecomm/sxia/.ssh/id_dsa.pub.
The key fingerprint is:
01:ae:a5:dc:ab:51:ef:4d:d5:a7:2a:87:1c:8b:6c:3f sxia@dmspar01
ii. cat id_dsa.pub >authorized_keys
- Run this command to confirm connection:
i. ssh dmspar02
Type password for dmspar02
Exit dmspar02
ii. sftp dmspar02
1. Input password for dmspar02
2. Run this command:
put authorized_keys
- On dmspar02
- Login by pprftp
- cd /home/pprftp
- mkdir .ssh
- Ensure authorized_keys is under/home/pprftp/.ssh
- Test the connectivity after that. The first time you are connecting to the server, you will get the following message.
The authenticity of host 'dmspar02 (172.17.111.29)' can't be established.
RSA key fingerprint is 2b:a7:e2:b7:aa:39:f0:a3:4d:9c:c2:3f:c2:e7:e7:99.
Are you sure you want to continue connecting (yes/no)?
Connectivity should go through without a password after that
- On dmspar01:
ssh dmspar02 or sftp dmspar02, Now, don’t need password.