Unexpected find of the day: scp -3 (secure copying files between servers)

Sometimes you find things are possible that you have worked around year after year. Like this little scp switch I encountered today.

When using scp, I usually copy files from my machine to a remote machine or vice versa. For the task of copying a file from one host to another, I’d copy it from the first host to my machine and then from my machine to the second host since all my servers are configured to only allow ssh connections from the admin network.

Used with “-3”, scp can do that for me in one step.

scp -3 hostA:file hostB:

will copy “file” from hostA to hostB using my machine for the transfer. Yai!

Advertisements

2 responses to “Unexpected find of the day: scp -3 (secure copying files between servers)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s