scp Automation

Hi, I have a requirement to automate SCP command. I have to write the scp command in server1 to copy file from server2 and paste it in server3. I will be passing server2 and server3 as variables. Pls suggest.

set up ssh keys - use ssh-keygen to do that. You need keys on all three unix servers.
The user who does the job on server1 has to have keys on server2 and server3. And unix accounts as well. NOT root account. Won't work unless someone has fouled up ssh security.

We just posted this same answer in a more complete form several times - so for details have a search on the forums for ssh-keygen