Problem : I needed to transfer files between to servers on an automated basis. In normal scp, it would prompt for a password and would not allow for automation.
Solution : Add the RSA public key of the sender on the .ssh folder of the receiver.
1) On the sender :
mkdir -p ~/.ssh ssh-keygen -t rsa ssh-keygen generates, manages and converts authentication keys for ssh(1). ssh-keygen can create RSA keys for use by SSH protocol version 1 and DSA, ECDSA or RSA keys for use by SSH protocol version 2. This should result in two files, ~/.ssh/id_dsa (private key) and ~/.ssh/id_dsa.pub (public key).
2) Copy ~/.ssh/id_rsa.pub (public key) to the receiver on the same directory.
scp ~/.ssh/id_rsa.pub user@receiver:~/.ssh/id_rsa.pub
3) Try ssh or scp from the sender to the receiver.
Known Assumption :
The same user has a login on both the sender and the receiver using a single sign-on server.