How to create a local network share in GNOME 3.34

If you need to create an SMB share on a Linux desktop, GNOME is there to help you.

How to create a local network share in GNOME 3.34

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).

Figure A

gnomesmba.jpg

The right-click menu in GNOME Files.

From the right-click contextual menu, select Local Network Share. In the resulting window (Figure B), click the check box for Share This Folder.

Figure B

gnomesmbb.jpg

Enabling the folder share for ~/Documents.

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.

Figure C

gnomesmbc.jpg

Installing the necessary software.

You will then be asked to confirm the installation of Samba. To do that, click Install (Figure D).

Figure D

gnomesmbd.jpg

Confirming the installation.

When prompted (Figure E), type your user password and click Authorize.

Figure E

gnomesmbe.jpg

Authorizing the installation.

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).

Figure F

gnomesmbf.jpg

Configuring the share.

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.

Figure G

gnomesmbg.jpg

Adding the necessary permissions.

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).

Figure H

gnomesmbh.jpg

Adding a new user to Samba.

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.

Also see

sambahero.jpg

Image: Jack Wallen