Home » Questions » Computers [ Ask a new question ]

SCP from one external server to another

SCP from one external server to another

I am trying to use SCP on my local server to copy a file from one remote server to another remote server (both remote servers use a custom port (xxxx)

Asked by: Guest | Views: 221
Total answers/comments: 2
Guest [Entry]

"did you check that direct authentication works from first remote host to the second one?

scp user@host:/file user@otherhost:/otherfile is shorthand for

ssh user@host scp /file user@otherhost:/otherfile

which leeds me to think:

ssh -p XXX user@host scp -P XXX /file user@otherhost:/otherfile might work."
Guest [Entry]

"Define the servers in your .ssh/config file, for example:

Host foobar
User youruser
Port 2222
Hostname the.real.hostname

Host foobar2
User youruser
Port 2222
Hostname the2.real.hostname

You can then simply do:

scp foobar:file foobar2:

and it will use the defined custom ports."