This blog post will teach you how to generate RSA key pair and use it to access an SFTP server without having to enter a password.
Step 1. Generate RSA key pair and verify that the keys are there.
Go to location
#cd /root/.ssh/
Generate rsa key
# ssh-keygen -t rsa
As shown in below image
Two files has been created.
id_rsa and id_rsa.pub
Copy pub key to Remote server from client.
#scp -pv id_rsa.pub root@192.168.10.22:/root/.ssh/
Step 2 : Login to Remote server
And authorized the public key into authorized key file.
Enter the location
#cd /root/.ssh/
Add public key into authorized key file.
#cat id_rsa.pub >> authorized_keys
As shown in below image.
Login to Client Computer
Now you can connect SFTP without password authentication.
#sftp -i id_rsa root@192.168.10.22:/swdump
As shown in below image.