Site icon WP Htaccess Editor

How to Transfer Files Over LAN Between Two Linux PCs

Transferring files over a Local Area Network (LAN) between two Linux PCs is an efficient and secure way to share large files without relying on third-party services or external storage devices. Whether you’re a system administrator, a developer working with multiple machines, or just someone trying to move files between two personal computers, understanding LAN file transfers can save you both time and effort.

Linux, being a powerhouse when it comes to networking, offers several fast and reliable methods for file transfer. From more traditional tools like rsync and SCP, to modern, user-friendly solutions like Warp or Warpinator, the variety means you can pick the one that best matches your use case and expertise level.

Advantages of LAN File Transfers

What You’ll Need

Now let’s explore some of the most effective ways to transfer files between your two Linux PCs over LAN.

1. Using SCP (Secure Copy Protocol)

SCP is a quick and simple command-line tool that uses SSH to securely transfer files between Linux machines.

Step-by-step:

  1. Ensure both machines have SSH installed. On both PCs run:
  2. sudo apt install openssh-server
  3. Check the IP address of the receiving PC:
    ip a or hostname -I
  4. From the sender PC, use the SCP command like this:

    scp filepath username@remote_ip:/destination/path

For example:
scp myfile.zip user@192.168.1.5:/home/user/Downloads

Note: You’ll be prompted for the remote user’s password unless passwordless SSH has been configured.

2. Using Rsync Over SSH

Rsync is not only good for syncing large amounts of data — it’s also a fantastic tool for file transfer. It compresses and only transfers differences, making it ideal for repeated transfers of updated files.

Example Command:

rsync -avz /source/folder user@remote_ip:/destination/folder

Advantages over SCP include

Make sure SSH is enabled on the remote machine, just as with SCP.

3. Using NFS (Network File System)

NFS allows one Linux system to mount a directory from another Linux system over a network, making the files behave almost as if they were on the local file system.

Steps to Set Up:

NFS is ideal for long-term file-sharing setups where both machines remain on the same LAN.

4. Using Samba for Cross-Platform Sharing

Samba is useful if one of the Linux systems will also be accessed by a Windows machine, as it uses the SMB protocol.

Basic Setup:

This method is a bit more complex, but it offers robust file-sharing features including user permissions and network browsing.

5. Using Netcat for Ad-Hoc Transfers

Netcat (nc) provides a fast, raw way to transfer files over TCP. While it’s not encrypted, it’s useful for quick, trusted-network transfers.

Example:

On the receiver PC:

nc -l -p 1234 > received_file

On the sender PC:

cat file_to_send | nc receiver_ip 1234

Netcat is often referred to as the “Swiss Army knife” of networking in Linux for a reason — it’s extremely flexible, but use it cautiously.

6. Using Warpinator (Beginner-Friendly)

If you and your colleague aren’t keen on command-line tools, Warpinator offers a graphical solution. Built by the Linux Mint team, it auto-detects other Warpinator-enabled devices on the LAN and makes drag-and-drop file sharing a breeze.

Steps:

  1. Install Warpinator:

    sudo apt install warpinator
  2. Launch it on both systems. The PCs will discover each other automatically.
  3. Send and receive files using Warpinator’s user-friendly interface.

This is a great tool for those who prefer GUI over CLI, without sacrificing speed and efficiency.

Tips for Smooth LAN File Transfers

In case you’re unsure about the IP addresses involved, command-line tools like ifconfig or ip addr can provide the details you need.

Which Method Should You Choose?

The “best” method really depends on your scenario:

Conclusion

Mastering LAN file transfers on Linux not only enhances your productivity but also deepens your understanding of how Linux systems communicate over networks. You don’t need to rely on internet speeds, USB drives, or clunky cloud apps. Instead, use the rich toolkit that Linux offers — from time-tested CLI tools to modern GUI apps — for fast, local file sharing. Whether you’re syncing codebases, backing up files, or just moving your favorite songs, there’s a LAN solution for every Linux user.

Exit mobile version