Remote copying

Transferring files between/from/to remote servers can be done in the following way:

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

where:

  • r - recursive copying (for directories),
  • p - saving the time of file creation,
  • C - compressing files (not relevant for transferring compressed files),
  • c - the fastest protocol for encryption.

In case of having any special needs when copying files use the reference for using the scp command.

man scp

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

For copying you will require the password of a remote user descending on the authorization scheme and rights of this user for writing to the destination path

If you perform copying from the root account, then you should check after transferring files that the target user (including the root) has the access to the folders anf the rights for writing.

For example, by running a command

ls -l /folder/subfolder

If needed - change theo owner by command

sudo chmod -R user:user /folder/subfolder

Or with the helpf or rsync:

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