How to securely copy files between Linux hosts using SCP and SFTP

Recently, we looked at the rsync command for syncing files between locations, and we discussed the similarity of usage and syntax when duplicating files and directories with the cp command. In that article, we looked at moving the bits back and forth on the same box, between filesystems, or between devices. In an upcoming article, we’ll look more at rsync as a tool to keep remote filesystems in sync with a local or backup version. In this article, I want to take a look at one of the most useful and used tools in the Linux sysadmin toolbox—the scp command.