I regularly share files and folders across my home network from Linux. In fact, I have one machine that houses a particular folder that is home to all of my first-draft manuscripts. When I decided I’d rather keep those files in-house (instead of risking a third-party cloud provider using them to train AI neural networks), Samba was the obvious solution.
Also: Linux kernel 6.8 offers some exciting new features and ‘fixes all over’
For someone who’s used Linux for decades, setting up a Samba share is a no-brainer. For those who are new to the open-source operating system, it’s not quite as simple. Thankfully, two of the most popular Linux GUIs (GNOME and KDE Plasma) make it a bit easier to create those shares.
I want to walk you through the process of doing just that, so you can create network shares on your Linux machine with ease.
How to share files across your network from these Linux GUIs
First: Installing Samba
What you’ll need: To make this work, you’ll need a Linux distribution with either the GNOME or KDE Plasma desktop environments. You’ll also need a user with sudo privileges. That’s it. Let’s make it happen. I’ll demonstrate on a Ubuntu-based distribution (Pop!_OS). If you use a Fedora-based distribution, make sure to swap out apt-get for the dnf package manager during the Samba installation process.
In case your Linux distribution didn’t ship with Samba pre-installed, you can install it with the command:
sudo apt-get install samba -y
If your distribution is Fedora-based, that command would be:
sudo dnf install samba -y
By default, users need to be added and enabled for Samba usage. This only requires two commands. The first adds the user to Samba with the command:
sudo smbpasswd -a USERNAME
Where USERNAME is your Linux username.
You’ll first be prompted for your sudo password and required to type and verify a password for Samba.
Also: BigLinux makes Linux easy for anyone – and it should be way more popular
Next, you must enable the user with the command:
sudo smbpasswd -e USERNAME
Where USERNAME is your Linux username.
Sharing from GNOME
To make this work with the Natilus file manager (aka “Files”), you need to install a piece of software with the command:
sudo apt-get install nautilus-share -y
If your distribution uses dnf, that command is:
sudo dnf install nautilus-share -y
You can restart Nautilus with the command:
nautilus -q
Open Nautilus and locate the folder you want to share. Right-click that folder and select Local Network Share.
In the resulting pop-up window, click the checkbox for Share this folder. Once you’ve done that, you can name the share, and then (if you want to give permission for users to alter the contents of the share) click the checkbox for Allow others to create and delta files in this folder. If you want to allow anonymous logins to the share, you can click the checkbox for Guest access (although I wouldn’t recommend that for security reasons).
Click Create Share and then, when prompted, click Add the permissions automatically. If you receive an error that includes “net usershare’ returned error 255,” you’ll need to run the following two commands:
sudo mkdir -p /var/lib/samba/usershares/ sudo chmod go+rwx /var/lib/samba/usershares/
Once you’ve done that, you should be able to access the shared folder from your network.
Sharing from KDE Plasma
Log into KDE Plasma and open the Konsole app. Issue the command:
sudo apt-get install kdenetwork-filesharing -y
If your distribution is based on Fedora, that command would be:
sudo dnf install kdenetwork-filesharing -y
Also: The top cloud storage services you can buy to protect your files
You’ll then need to go through the same process outlined above for adding and enabling your users for Samba shares.
Right-click on the folder you want to share and click Properties. In the resulting pop-up, click on the Share tab.
At the top of the Share tab, you’ll probably see a warning with a button marked Fix Permissions. Click that button. When prompted, click Change Permissions.
Back at the Share tab, click the checkbox for Share this folder with other computers on the local network. Once you’ve done that, you can then configure the share by giving it a name and allowing/configuring guest access. I would suggest leaving Everyone with Read Only permissions and giving your user Full Control. Once you’ve done that, click OK.
Also: The first 5 Linux commands every new user should learn
Once you’ve taken care of these steps, you can share any folder (so long as you have permission to access it) from your Linux machine to your network.