If you need to create an SMB share on a Linux desktop, GNOME is there to help you.
When you work on a network with other users who need access to specific directories on your desktop machine, what do you do when said desktop is of the GNOME sort? You share out the directories with ease. That's right, thanks to the latest iterations of GNOME, creating a local network share is incredibly easy.
I'm going to walk you through the process of creating such a share on your desktop. Once taken care of, those who have permission to access the share will be connecting at will.
SEE: 10 free alternatives to Microsoft Word and Excel (TechRepublic download)
What you'll need
- A Linux desktop machine, running the latest version of GNOME
- A directory to share
- A user account with sudo privileges
I'll be demonstrating on a Ubuntu 19.10 workstation with GNOME 3.34.
How to create the share
The first thing to do is create the share. To illustrate the process, I'll share out the ~/Documents folder of one user on the Linux system (specifically /home/jack/Documents).To do this, log in as the user in question and open GNOME Files. Navigate to the home directory and right-click Documents (Figure A).
From the right-click contextual menu, select Local Network Share. In the resulting window (Figure B), click the check box for Share This Folder.
Chances are you haven't installed the Windows networks sharing service (Samba) on the system. That's okay, because GNOME is there to help you out. When prompted (Figure C), click Install Service.
You will then be asked to confirm the installation of Samba. To do that, click Install (Figure D).
When prompted (Figure E), type your user password and click Authorize.
Once the installation completes, you'll find yourself back at the Folder Sharing window, where you can then name the share, add a comment, and specify the permissions for the share (Figure F).
A word on permissions: If those you share the folder with only need read access, leave the first checkbox unchecked. However, if those users need to be able to create and delete files within that folder, make sure to check that box. If you only want to allow users with a system account access, make sure to leave the Guest Access box unchecked. Should you go that route, you'll then have to create users on your system for that purpose.
Should you check the box for Guest Access, it means anyone on the network who knows the location of your share will have access to the data within. For security purposes, you should not make use of this feature.
After you've configured the share, click Create Share.
Another warning will popup (Figure G), this time asking you to allow GNOME to set the necessary permissions for the share automatically. Click Add The Permissions Automatically to make this happen.
That's it. Your share has been created.
How to add users
This is where we leave behind the GUI. Yes, you can create new users on your account from within the GNOME Settings tool. Unfortunately, what you cannot do via a GNOME GUI, is add those new users to Samba. To do this, open a terminal window and issue the following commands (where USER is the username to be added):
sudo smbpasswd -a USER
You will then be prompted to type and verify a new password for that user (Figure H).
Finally, that new user must be enabled with the command:
sudo smbpasswd -e USER
That's it. The new user has been added and enabled. You should now be able to access that newly-created share from another machine on your network.
- How to become a software engineer: A cheat sheet (TechRepublic)
- Choosing your Windows 7 exit strategy: Four options (TechRepublic Premium)
- How to auto mount FAT32-formatted drives in Samba (TechRepublic)
- How to enable Samba connections via hostname (TechRepublic)
- How to share a folder from a Linux data center with this easy Samba GUI (TechRepublic)
- How to install the GNOME Desktop on Ubuntu Server 18.04 (TechRepublic)
- Libarchive vulnerability can lead to code execution on Linux, FreeBSD, NetBSD (ZDNet)
- It takes work to keep your data private online. These apps can help (CNET)
- Must-read coverage: Programming languages and developer career resources (TechRepublic on Flipboard)