Want to use sftp to conect to a remote server without giving password (this depends) some remotes server require some do not.
ssh-keygen
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/userdir/peoplesoft/.ssh/id_rsa): /home/userdir/peoplesoft/.ssh/trial_rsa
Enter passphrase (empty for no passphrase): press enter to avoid giving a password.
(if you give a password , when connecting to remote we have to key in this password)
trial_rsa and trial_rsa.pub will be generated.
.pub file needs to the organization whose server we are trying to sftp. That organization will import the public key.
Once that is done
Create a config file in the .ssh folder with below details
host trial (u can give any name)
hostname name of the remote server
user <username>
port 22 (usually , else whatever is specified)
IdentityFile <path>/trial
PasswordAuthentication no
once you save this file , you should be able to connect using the below command
sftp trial (where trial is the name given against host in the config file)
you will observe that an entry will be added to the know_hosts file in the .ssh folder.
if you see the below error