Secure file transfers – not sexy but important
The perma admin-sexy Stuart Burns takes you through the fundamentals of securely transferring important files around systems.
Rsync can copy files locally, as shown. Useful for big copy operations.
Transferring files is not the most interesting subject in Linux administration but it is important. Sometimes as an administrator, you need to transfer large amounts of files to a remote system. Where one method fails, another may work.
There are several ways to duplicate data between systems efficiently. Below we demonstrate some of the methods and the scenarios where each has a best fit.
Clue’s in the name
SCP is the great grandfather of securely (encrypted) copying data between two systems. It is OK for small, quick file copies but it is showing its age. It is inefficient and not very communicative regarding progress.
SCP (Secure Copy Protocol) is the default method for copying files between hosts without installing additional tools. It’s built in to most Unix/Linux-like systems. It relies on the SSH server working on both source and destination. The underlying OpenSSH server takes care of the encryption. To copy a file from the local system to the remote system is as simple as: $ scp myfile.txt sysadmin@remotehost:/home/sysadmin/