I want to transfer files from say server A to server B directly. The script performing this operation is residing on some other server say C. How can it be achieved without being saving files temporarily on server C or local system..
1 Answer
Create ssh key pairs for each server, use ssh-copy-id to copy public keys from server A to Server B, and from Server C to Server A.
All you have to do then is to tell your script to ssh to remote server A and then execute scp to copy files over to Server B.
Edit: You have to setup your ssh keys without a passphrase ! (Or use ssh-agent on server C and server A)