5 more ways to share files on Linux that every pro should know

6 hours ago 13
gettyimages-2157445947
Elizabeth Fernandez/Moment via Getty

Follow ZDNET: Add us as a preferred source on Google.


ZDNET's key takeaways

  • These are some lesser-known ways of sharing files on Linux.
  • The methods here range from the very simple to the very complicated.
  • Each of these tools is free, and some are pre-installed.

Back in 2024, I wrote about how to share files between Linux devices. That article focused on the obvious tools (such as Samba and SCP), so I thought I'd revisit the topic, only highlighting the lesser-known options (especially for those new to Linux).

Some of these options are fairly simple to use, while others are a bit more demanding and require considerable setup time. Others are easy and can be taken care of in seconds. Either way you go, you'll end up with a system that allows you to reliably share files between your Linux devices.

If that sounds like something you need at the moment, then read on and enjoy the flexibility inherent in Linux.

Also: The best Linux distros for beginners in 2025 make switching from MacOS or Windows so easy

1. GNOME's built-in file sharing

This is, by far, the easiest method. Most distributions that use GNOME (or GNOME-based desktop environments) include built-in file-sharing systems that are as easy to enable as clicking a button. Unfortunately, the KDE Plasma desktop (and others like Xfce) do not include such a simple means for file sharing (so you have to resort to other methods). 

In GNOME, go to Settings > Sharing and first enable the Sharing service (at the top right of the window). Once you've done that, enable File Sharing and you're done. You can also require a password and even limit it to specific networks. Once you've enabled the feature, your ~/Public folder should appear in various file managers on your network, where you can copy/paste files to and from.

2. SFTP

SFTP is the secure sibling of FTP and uses SSH as an underlying mechanism for transporting data packets. The SFTP connection even uses the default SSH port (22) and encrypts the data stream to protect both the contents of the file and the commands that are used for the transfer. SFTP also uses the SSH authentication method, which means it honors SSH key authentication, so you can get even more security for your connections and transfers. 

Also: 8 ways I quickly leveled up my Linux skills - and you can too

Once connected (using a command like sftp USER@IP_ADDRESS), you can interact with the remote machine using commands similar to those of FTP, such as get (for receiving a file) and put (for sending a file). You can also send and receive directories using the -r (recursive) option. For example, you could send the zdnet.txt file with the command put zdnet.txt. You could receive such a file with the command get zdnet.txt. Good news: most Linux file managers have built-in support for SFTP, so you can connect to a remote machine from within the file manager and use a GUI instead of commands to send and receive files.

3. Web-based

You might not know this, but the Apache web server makes it possible to share files between machines. You have to have Apache installed on your machine, and then spend some time configuring it. Once you have Apache installed, you'll need to modify the apache.conf file (in /etc/apache2), adding something like this:

<Directory /var/www/html/DATA>
   Options FollowSymLinks Indexes
   AllowOverride None
  Order allow,deny
   allow from all
</Directory>

Where DATA is the directory to be shared.

Then, enable autoindexing with the command:

sudo a2enmod autoindex

Restart Apache with:

sudo systemctl restart apache2

Once this is set up, you can access the files within the shared directory.

4. Rsync

You probably know rsync as a tool for backup, but it's also capable of local and remote file copying. The rsync tool is available for installation from your distribution's standard repository, and there are even some GUI tools (such as grsync) to make the task of sending/receiving files even easier. Once installed, you can use the rsync command to send a file like so:

rsync -avzh ~/zdnet.txt USER@IP_ADDRESS:/home/USER

Where USER is your remote username and IP_ADDRESS is the IP address of the remote machine. You can also receive with rsync like so:

rsync -avzh USER@IP_ADDRESS:/home/USER/zdnet.txt ~/

If you want to try rsync, I would suggest trying one of the GUIs first.

5. NFS

NFS (Network File System) is the most complicated setup on this list. Not only do you have to install and configure NFS, but you have to mount the NFS shares on remote machines, so they can be accessed. The process looks something like this:

  1. Install nfs-common
  2. Create the shared directories on the host
  3. Configure/etc/hosts file for the directory to share and the allowed IP address(es)
  4. Restart nfs-kernel-server
  5. Adjust your firewall to allow nfs traffic
  6. Create mount points on the client
  7. Mount the remote directory
  8. Use it

Also: How to create Samba share on Linux for guests to access on your network

If you don't mind having to set up mount points for a share, NFS is a reliable option, especially because it's much faster than Samba. If you have a lot of smaller files to share, I would recommend going with NFS over Samba every time (versus Samba for fewer, larger files).

Want to follow my work? Add ZDNET as a trusted source on Google.

Read Entire Article