Remote copy

You can transfer files from//to remote servers like this:

sudo scp -rpC -c blowfish source/. user@server:/folder

Where:

  • r - recursive copying (for directories),

  • p - saving the file creation time,

  • C - file compression (irrelevant when transferring files compressed by a compressor),

  • c is the fastest encryption protocol.

If you have special copying needs, see the help for the scp command.

man scp

You can also start remote copying from a third server between two others.

To copy, you will need to know the remote user’s password or have its key (depending on the authorization scheme) and this user has write rights to the destination folder.

If you are copying from under the system account - root, then after transferring the files you need to check that the target user (including the system user) has the right to access the folders and the right to write.

For example, by running the command:

ls -l /folder/subfolder

If necessary, change the owner with the command

sudo chmod -R user:user /folder/subfolder

Or using rsync:

rsync -avh /path/to/files user@server:/new_path