Secure Copy: scp
June 10, 2002 by daynah
Filed under Daily Ramblings
Someone asked me how to copy a file from one server to another today, so I thought I’d share it. To do this, you can use secure copy if you are on a linux server.
1) Log into one of the servers.
2) ‘cd’ into the directory you want the file to be in (or where the file is – this will depend on which server you are on, the destination or the source?)
3) Type:
scp file_being_copied file_destination
If you are on the “source” server, ‘file_being_copied’ will be the filename.
Example: myfile.php
If you are on the “destination” server, ‘file_being_copied’ will be “username@sourceserver:filename’
Example: username@sourceserver:myfile.php
So your command would looklike this if you are on the source server:
scp . username@sourceserver:myfile.php
And your command would look like this if you are on the destination server:
scp username@sourceserver:myfile.php .
scp source destination


@






