File sharing: scp, rsync, NFS, Samba
Sign in to read this lesson
Copying a backup to another server, moving a site to a new server, a shared directory for several servers, a network drive for Windows users — each is done with a different tool. In this lesson we learn scp and rsync over SSH, NFS between Linux machines, and Samba sharing with Windows.
What you will learn
scp file [email protected]:/path/— a one-off copy over SSH.rsync -avz --delete source/ target/sends only the changed parts; check with--dry-runfirst, and the trailing/matters.- NFS shares a directory between Linux servers like a network disk:
/etc/exports→exportfs -ra→mounton the client. - Samba (SMB) is for sharing with Windows:
/etc/samba/smb.conf, users added withsmbpasswd -a. - Open each share in the firewall only to the network that needs it: NFS 2049, SMB 445.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.