Transferring files through the network
A major use for networking computers is resource sharing. Files are a common shared resource. There are different methods for transferring files between systems, ranging from a USB stick and sneakernet
to network links such as NFS and Samba. These recipes describe how to transfer files using the common protocols FTP, SFTP, RSYNC, and SCP.
Getting ready
The commands for performing file transfer over the network are mostly available by default with Linux installation. Files can be transferred via FTP using the traditional ftp
command or the newer lftp
, or via an SSH connection using scp
or sftp
. Files can be synchronized across systems with the rsync
command.
How to do it...
File Transfer Protocol (FTP) is old and is used in many public websites to share files. The service usually runs on port 21
. FTP requires that an FTP server be installed and running on the remote machine. We can use the traditional ftp
command or the newer lftp
command to access an FTP...