How To

Configure Samba File Sharing on Linux Mint 22

Samba lets you share files between Linux and Windows machines over a network using the SMB/CIFS protocol. On a Linux Mint desktop, this is the most practical way to make folders accessible to Windows PCs on the same LAN, or to mount Windows shares on your Mint box. The setup takes about 10 minutes.

Original content from computingforgeeks.com - post 161440

This guide covers two share types: a public share that anyone on the network can access without a password, and an authenticated share restricted to specific Samba users. The server side runs on Linux Mint (or Ubuntu), and we test access from Linux clients, Windows, and the Mint file manager.

Tested March 2026 on Ubuntu 24.04 (same packages as Linux Mint 22). Samba 4.19.5.

Server Side: Install and Configure Samba

All steps in this section run on the Linux Mint machine that will host the shared folders.

Install Samba

Open a terminal and install the Samba server package:

sudo apt update
sudo apt install -y samba samba-common-bin

Verify Samba installed and the service is running:

smbd --version
sudo systemctl status smbd --no-pager | head -5

Confirm smbd shows active (running):

Version 4.19.5-Ubuntu
● smbd.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smbd.service; enabled; preset: enabled)
     Active: active (running) since Thu 2026-03-26 11:43:19 UTC; 22ms ago
       Docs: man:smbd(8)

Create Share Directories

Create two directories: one for the public share and one for authenticated access. Using /srv/samba/ keeps shares organized and separate from home directories.

sudo mkdir -p /srv/samba/public
sudo mkdir -p /srv/samba/projects

Set permissions. The public share needs world-writable access. The projects share is restricted to the sambashare group (created automatically when Samba is installed), with the setgid bit so new files inherit the group:

sudo chmod 0777 /srv/samba/public
sudo chgrp sambashare /srv/samba/projects
sudo chmod 2770 /srv/samba/projects

Create a Samba User

Samba maintains its own user database, separate from Linux system users. Create a dedicated Samba user with no login shell and add them to the sambashare group:

sudo useradd -M -d /dev/null -s /usr/sbin/nologin -G sambashare smbuser1

Set the Samba password (this is separate from any Linux password):

sudo smbpasswd -a smbuser1
sudo smbpasswd -e smbuser1

The -a flag adds the user to the Samba database. The -e flag enables the account. You’ll be prompted to enter and confirm the password.

To add more users later, repeat these commands with a different username. Any user in the sambashare group automatically gets access to the projects share.

Configure smb.conf

Back up the default configuration file, then replace it:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo vi /etc/samba/smb.conf

Replace the contents with:

[global]
   workgroup = WORKGROUP
   server string = Samba on %h
   server role = standalone server
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   map to guest = bad user

[public]
   comment = Public Share (no authentication required)
   path = /srv/samba/public
   browseable = yes
   read only = no
   guest ok = yes
   create mask = 0664
   directory mask = 0775

[projects]
   comment = Authenticated project share
   path = /srv/samba/projects
   browseable = yes
   read only = no
   guest ok = no
   valid users = @sambashare
   create mask = 0660
   directory mask = 2770
   force group = sambashare

What each section does:

  • [global] – Sets the workgroup (match your Windows network, typically WORKGROUP), logging, and maps unknown users to guest access.
  • [public] – A share at /srv/samba/public that anyone on the network can read and write without credentials. guest ok = yes is the key setting.
  • [projects] – A share at /srv/samba/projects restricted to members of the sambashare group. force group = sambashare ensures all files created through Samba are owned by the group, preventing permission issues between users.

Validate and Start

Check the configuration for syntax errors:

testparm -s

A clean config produces:

Load smb config files from /etc/samba/smb.conf
Loaded services file OK.

Server role: ROLE_STANDALONE

[global]
	log file = /var/log/samba/log.%m
	map to guest = Bad User
	max log size = 1000
	server role = standalone server
	server string = Samba on %h

[public]
	comment = Public Share (no authentication required)
	create mask = 0664
	directory mask = 0775
	guest ok = Yes
	path = /srv/samba/public
	read only = No

[projects]
	comment = Authenticated project share
	create mask = 0660
	directory mask = 02770
	force group = sambashare
	path = /srv/samba/projects
	read only = No
	valid users = @sambashare

If testparm shows errors, fix them before proceeding. Now restart Samba to apply the new configuration:

sudo systemctl restart smbd nmbd

Samba uses two services: smbd handles file sharing, nmbd handles NetBIOS name resolution so Windows machines can find the server by hostname.

Open the Firewall

If ufw is enabled, allow Samba through:

sudo ufw allow samba
sudo ufw status

This opens TCP ports 139 and 445 (SMB), plus UDP ports 137 and 138 (NetBIOS):

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Samba                      ALLOW       Anywhere

Verify Samba is listening:

ss -tlnp | grep -E "445|139"

Both ports should show as LISTEN:

LISTEN  0  50  0.0.0.0:139  0.0.0.0:*  users:(("smbd",pid=12872,fd=31))
LISTEN  0  50  0.0.0.0:445  0.0.0.0:*  users:(("smbd",pid=12872,fd=30))

The server is ready. Everything below happens on the client machine.

Alternative: Share a Folder via Nemo (GUI Method)

Linux Mint’s Nemo file manager includes a right-click “Sharing Options” dialog that creates a Samba share without editing smb.conf. It uses Samba’s usershare mechanism, which lets regular users add shares without root privileges. The GUI is convenient but has specific permission requirements that trip up most users. This section documents them explicitly.

The CLI method covered earlier is more reliable for anything beyond a quick personal share. If you are hosting files for other people, stick with the /srv/samba/ approach above. Use the GUI method when you want to share a folder inside your home directory for temporary access from another device on your LAN.

Enable the usershare System

On Debian 13, Ubuntu 24.04, and Linux Mint 22, the usershare max shares setting is commented out in /etc/samba/smb.conf by default, which silently disables the feature. Your Nemo GUI shares will appear to create successfully but be invisible to clients. Enable it:

sudo sed -i '/usershare allow guests/a\   usershare max shares = 100' /etc/samba/smb.conf
sudo systemctl restart smbd

Confirm the setting took effect:

grep 'usershare max shares' /etc/samba/smb.conf

You should see the uncommented line:

   usershare max shares = 100

Add Your User to the sambashare Group

Only members of the sambashare group can create usershares:

sudo usermod -aG sambashare $USER

Log out and back in (or run newgrp sambashare) for the group change to take effect. Verify:

groups | grep sambashare

Fix Home Directory Permissions (The Critical Step)

This is where most users get stuck. By default, your home directory on Debian, Ubuntu, and Linux Mint is mode 700 (drwx------), which blocks the Samba daemon from traversing into any folder you share through Nemo. The share will be created successfully, but any client trying to read or write will get NT_STATUS_ACCESS_DENIED, even with the correct password.

Check your home directory permissions:

stat -c '%a %U:%G' /home/$USER

If the output shows 700, the share will fail silently when clients connect. Grant “other” read and execute (traversal) permission on the home directory so the Samba daemon can reach the shared folder:

chmod o+rx /home/$USER

This sets the mode to 705 (drwx---r-x). It does not expose your personal files to other users on the same machine because “other” only has directory traversal permission, not directory listing. Individual files inside your home retain their original permissions.

Share the Folder via Nemo

In Nemo, right-click the folder you want to share and select Sharing Options. Check Share this folder, set a share name, and optionally check Allow others to create and delete files in this folder and Guest access. Click Modify Share.

Nemo runs the following command behind the scenes to create the usershare (you can run it directly from the terminal if you prefer):

net usershare add Videos /home/$USER/Videos "My video share" Everyone:F guest_ok=y

Verify the share was created:

net usershare list

Get detailed information:

net usershare info Videos

The output shows the share definition:

[Videos]
path=/home/matt/Videos
comment=My video share
usershare_acl=Everyone:F,
guest_ok=y

Enable Write Access

If you ticked “Allow others to create and delete files” in Nemo, you also need to give the filesystem permission that allows writes. The usershare ACL is one layer, the Unix filesystem permissions are another, and both must allow the write:

chmod 777 /home/$USER/Videos

Test read access from another machine:

smbclient //192.168.1.130/Videos -N -c 'ls'

Test write access:

smbclient //192.168.1.130/Videos -N -c 'put /etc/hostname test.txt; ls'

Both operations should succeed with output similar to:

putting file /etc/hostname as \test.txt (140000.0 kb/s) (average inf kb/s)
  .                                   D        0  Fri Apr 10 21:51:47 2026
  ..                                  D        0  Fri Apr 10 21:51:47 2026
  test.txt                            A       14  Fri Apr 10 21:51:35 2026

To remove the share later, run:

net usershare delete Videos

Client Side: Access Shares from Linux

These steps run on the machine that needs to access the shared folders (another Linux Mint box, Ubuntu, Debian, or any Linux distribution). Replace 192.168.1.130 with your Samba server’s IP address throughout.

Install Client Tools

Install the SMB client and CIFS mount utilities:

sudo apt install -y smbclient cifs-utils

List Available Shares

Discover what the Samba server is sharing:

smbclient -L //192.168.1.130 -N

The -N flag means no password (anonymous). Both shares should appear:

	Sharename       Type      Comment
	---------       ----      -------
	public          Disk      Public Share (no authentication required)
	projects        Disk      Authenticated project share
	IPC$            IPC       IPC Service (Samba on samba-server)

Interactive Access with smbclient

Connect to the public share as a guest:

smbclient //192.168.1.130/public -N

This drops you into an interactive SMB shell where you can use ls, get, put, and exit:

smb: \> ls
  .                                   D        0  Thu Mar 26 11:57:32 2026
  ..                                  D        0  Thu Mar 26 11:57:32 2026
  readme.txt                          N       28  Thu Mar 26 11:46:47 2026

smb: \> put /etc/hostname testfile.txt
putting file /etc/hostname as \testfile.txt (12.7 kb/s) (average 12.7 kb/s)
smb: \> exit

For the authenticated projects share, connect as smbuser1:

smbclient //192.168.1.130/projects -U smbuser1

Enter the Samba password when prompted. Attempting guest access to this share is correctly denied:

smbclient //192.168.1.130/projects -N

The connection is rejected as expected:

tree connect failed: NT_STATUS_ACCESS_DENIED

Mount Shares with CIFS

For regular file access through your file manager and applications (not just the interactive SMB shell), mount the share to a local directory:

sudo mkdir -p /mnt/samba-public
sudo mount -t cifs //192.168.1.130/public /mnt/samba-public -o guest

For the authenticated share:

sudo mkdir -p /mnt/samba-projects
sudo mount -t cifs //192.168.1.130/projects /mnt/samba-projects -o username=smbuser1

Verify both mounts are active:

df -hT | grep cifs

Both shares should appear as mounted filesystems:

//192.168.1.130/public   cifs    29G  2.4G   26G   9% /mnt/samba-public
//192.168.1.130/projects cifs    29G  2.4G   26G   9% /mnt/samba-projects

Persistent Mounts with fstab

The mounts above are lost on reboot. To make them persistent, add entries to /etc/fstab.

For the authenticated share, never put passwords directly in fstab. Create a credentials file instead:

sudo vi /root/.smbcredentials

Add the username and password:

username=smbuser1
password=your_samba_password

Lock down the file so only root can read it:

sudo chmod 600 /root/.smbcredentials

Now add the fstab entries:

sudo vi /etc/fstab

Append these lines (replace the IP with your Samba server’s address):

//192.168.1.130/public    /mnt/samba-public    cifs  guest,uid=1000  0  0
//192.168.1.130/projects  /mnt/samba-projects  cifs  credentials=/root/.smbcredentials,uid=1000  0  0

Test by unmounting and remounting through fstab:

sudo umount /mnt/samba-public /mnt/samba-projects
sudo mount -a

Verify the mounts came back:

df -hT | grep cifs

Both shares should reappear:

//192.168.1.130/public   cifs    29G  2.4G   26G   9% /mnt/samba-public
//192.168.1.130/projects cifs    29G  2.4G   26G   9% /mnt/samba-projects

These mounts will now survive reboots.

Client Side: Access from Windows

On a Windows machine on the same network, open File Explorer and type the server address in the address bar:

\\192.168.1.130

You should see both public and projects shares listed. The public share opens without credentials. For the projects share, Windows will prompt for a username and password. Enter the Samba username (smbuser1) and the password you set with smbpasswd.

To map a share as a network drive: right-click This PC, select Map network drive, and enter \\192.168.1.130\projects as the folder path. Check “Connect using different credentials” and enter the Samba user credentials.

Client Side: Access from the Linux Mint File Manager

In Linux Mint’s Nemo file manager (or any GTK file manager like Nautilus), click File > Connect to Server or type directly in the address bar:

smb://192.168.1.130/public

For the authenticated share:

smb://192.168.1.130/projects

Nemo will prompt for the username, domain (use WORKGROUP), and password.

Server Side: Adding More Users

Back on the Samba server, add another user with access to the projects share:

sudo useradd -M -d /dev/null -s /usr/sbin/nologin -G sambashare smbuser2
sudo smbpasswd -a smbuser2
sudo smbpasswd -e smbuser2

No config changes or restarts needed. The valid users = @sambashare directive in the projects share automatically grants access to all members of the sambashare group.

Troubleshooting

NT_STATUS_ACCESS_DENIED when connecting

This means authentication failed. On the server, verify the user exists in Samba’s database:

sudo pdbedit -L

If the user is not listed, re-add them with sudo smbpasswd -a username. Also confirm the user is in the sambashare group: groups username.

Share not visible from Windows

On the server, check that nmbd is running (sudo systemctl status nmbd) and the firewall allows Samba (sudo ufw status). On the Windows client, verify the machine is on the same WORKGROUP. You can also try the direct path: type \\server-ip\sharename in File Explorer instead of browsing the network.

Permission denied when writing files

On the server, check that the Samba user is in the sambashare group and the directory has the correct group ownership:

ls -la /srv/samba/projects/

The directory should show drwxrws--- with group sambashare. The s in the group execute position is the setgid bit, which ensures new files inherit the group.

mount.cifs: iocharset utf8 not found

This error appears on the client when the nls_utf8 kernel module is missing (common on minimal server installations). Either load it with sudo modprobe nls_utf8, or remove the iocharset=utf8 option from your mount command and fstab entry. Modern Samba handles UTF-8 correctly without this option.

Nemo GUI: “The permissions for /path prevent other users from accessing this share”

This error appears when you try to share a folder through Nemo’s Sharing Options dialog on Linux Mint. Nemo is complaining about the filesystem permissions on the parent directory path, not the folder you’re trying to share. The Samba daemon needs “other” execute (traversal) permission on every directory from / down to the shared folder. By default, your home directory is mode 700 which blocks this.

The fix is a single command:

chmod o+rx /home/$USER

This sets your home directory to mode 705 (drwx---r-x). Other users on the same machine still can’t list your home directory contents (no read bit for “other”), but the Samba daemon can now traverse into your shared subfolder. Individual file and subfolder permissions inside your home are unchanged.

After fixing the permission, close and reopen the Sharing Options dialog in Nemo. The error should be gone. If the share still fails to accept writes from clients, also make the shared folder itself writable:

chmod 777 /home/$USER/Videos

Replace Videos with your actual folder name. See the Alternative: Share a Folder via Nemo section above for the complete GUI workflow.

Share Created in Nemo but Invisible to Clients

On fresh installs of Debian 13, Ubuntu 24.04, and Linux Mint 22, the usershare max shares setting is commented out in /etc/samba/smb.conf, which silently disables the usershare feature. Nemo reports success but the share is never loaded by smbd. Fix it by uncommenting the line and restarting Samba:

sudo sed -i '/usershare allow guests/a\   usershare max shares = 100' /etc/samba/smb.conf
sudo systemctl restart smbd

Related Articles

Networking How Physical Location Affects Your Browsing Experience Monitoring Install and Configure Telegraf on RHEL 8 / CentOS 8 Networking Configure BIND9 DNS Master and Slave on Rocky Linux 10 Networking Install Metasploit Framework on Arch | Manjaro | Garuda Linux

12 thoughts on “Configure Samba File Sharing on Linux Mint 22”

  1. trying to follow this as new user and, well it’s near impossible.
    you say to edit the smb.conf file. I enter the command you say but it won’t let me add or edit anything so how can I add the info if I can’t type anything?
    have not bothered with the rest of the tut as if I can’t add to the smb.conf file I guess the rest is moot
    would be nice if you had included HOW to add/edit the smb file for beginners.

    Reply
    • Hi, we are sorry for that, we know it can be very frustrating to use vim, especially it you are a beginner. We apologise for that. In response to this, please check the guide again, we have updated in with explicit instructions, thank you.

      Reply
  2. Hello, I am having trouble getting wordpress to let me comment on this post, so if I end up spamming I am very sorry it is not intentional.

    Basically, after performing “sudo mount -a” I get an error message telling me that the part containing my username, password, uid, and gid is an “Invalid argument”. I tried “systemctl daemon-reload”, but that has not resolved the issue.

    Please help. Thank you.

    Reply
    • Hi Joe, I can reproduce your exact error. The issue is that uid= and gid= in the CIFS mount options need numeric values, not usernames, on most modern kernels. For example, if your username is “joe”, find your numeric UID/GID first:

      id joe

      Then use the numbers (typically 1000) in the fstab entry. Also, the article recommends using a credentials file instead of putting the password directly in fstab. The correct fstab entry looks like:

      //192.168.1.208/sharename /mnt/shares cifs credentials=/root/.smbcredentials,uid=1000,gid=1000 0 0

      Where /root/.smbcredentials contains your username and password (see the “Persistent Mounts with fstab” section in the article). After fixing the fstab entry, run sudo systemctl daemon-reload then sudo mount -a.

      Reply
  3. I also got stuck at editing the conf file. But, regardless, the fact that a user has to go through all this just to share folder access on a home network is why Linux fails. This is something that should be a few clicks in gui, not lines and lines of typed commands.

    Reply
    • Hi Matt, fair point about the conf file editing. If vi is not comfortable, you can use a graphical text editor instead: sudo xed /etc/samba/smb.conf (Linux Mint ships xed as the default text editor). You can also copy the config block from the article and paste it directly into xed.

      That said, Linux Mint does have a GUI option for basic sharing. Right-click any folder in the file manager, select Properties, then the Share tab. That uses Samba under the hood and handles the config automatically. The limitation is that it only covers simple folder shares without fine-grained permissions, groups, or guest access, which is why the article covers the manual approach.

      If you got stuck at a specific step, let me know which part and I can help troubleshoot.

      Reply
  4. I tried to enable it through the gui, but the share failed saying: the permissions for /path prevent other users from accessing this share. When I go to permissions, owner and groups have create and delete files, but no file access. If I change file access, it reverts as soon as I hit apply permissions to enclosed files. When I go to another device, it sees the folder through vlc, but asks for a login and password, and I haven’t been able to get access.

    Reply
    • Hi Matt, that error comes from Nemo’s “Share this folder” GUI, which uses Samba’s usershare mechanism. It fails for a specific reason: the directory (and its parent path) must be readable and executable by “other” at the filesystem level, not just owner/group. Home directories on Mint default to drwxr-x— (mode 750), which blocks the Samba daemon from traversing into the folder even if the share definition is correct. That is why your permission changes “revert” and why the remote machine sees the share name (via NetBIOS browsing) but can’t actually open it.

      You have two options:

      Option 1: Fix Nemo’s GUI share

      Open a terminal and give the path “other” traversal permission all the way up to the shared folder. For example, if you are sharing /home/matt/Videos:

      chmod o+rx /home/matt
      chmod -R o+rx /home/matt/Videos

      Then in Nemo, right-click the folder, Properties, Permissions tab, make sure “Others” access is at least “Access files”, and in Sharing Options tick “Allow others to create and delete files in this folder” if you want writes. Also make sure you are in the sambashare group:

      sudo usermod -aG sambashare $USER

      Log out and back in for the group change to take effect.

      Option 2 (recommended): Skip the GUI and use the CLI approach in the article

      The /srv/samba/public or /srv/samba/projects setup in this guide sidesteps the permission tangle entirely because it uses a dedicated directory with explicit 0777 or 2770 permissions and a proper smb.conf entry. It’s more reliable than the Nemo GUI for anything beyond a throwaway share, and it works the same on Mint 22, Ubuntu, and Debian.

      For your “sees the folder in VLC but asks for login” symptom specifically: that happens because nmbd advertises the share name even when the actual share was never created. Once you fix the permissions or switch to the CLI method, the login prompt will either accept your Samba credentials (if you ran smbpasswd -a username) or the share will be accessible as guest. If you haven’t set a Samba password yet, run:

      sudo smbpasswd -a $USER

      and use that password when VLC or another client prompts. The Samba password is separate from your Linux login password.

      Let me know which path you take and if you still hit issues.

      Reply
  5. Something went wrong. I typed in

    chmod o+rx /folder path
    chmod -R o+rx /folder path

    First line returned no errors, second line returned

    Chmod: cannot access ‘o+rx: no such file or directory.

    And now I have to authenticate and get elevated privileges just to get into the folder. I also now have a persistent error : A problem has been detected with your thumbnail cache. Fixing it will require administrative priveliges. If I click to fix it it comes right back whenever I switch to a different folder.

    Reply
  6. Okay scratch that. I copied the conf file and it fixed most of my issues.

    ALL I have left now is my shared folders don’t have guest access. It’s greed out in the settings. I’ve tried adding:

    path = /folder location
    path = /folder location

    To the conf file under
    path = /srv/samba/public
    In an attempt to eliminate the need for login/pw, but it didn’t seem to do anything…

    Reply
    • Good progress, the smb.conf approach is the right path. Two things to fix:

      First, the guest checkbox is greyed out in Nemo because the article’s smb.conf is missing the usershare directives. Add these two lines inside the [global] section:

      usershare allow guests = yes
      usershare max shares = 100

      Run sudo xed /etc/samba/smb.conf and add them right after the “map to guest = bad user” line. Restart Samba with sudo systemctl restart smbd. The guest checkbox in Nemo’s Sharing Options will be available after that.

      Second, adding multiple path= lines under [public] does not work. Samba only reads the last path= in each section and ignores the rest. Each folder you want to share needs its own section block. For example, if you want to share /home/matt/Videos and /home/matt/Music as guest shares, add them as separate sections at the bottom of smb.conf:

      [Videos]
      path = /home/matt/Videos
      browseable = yes
      read only = no
      guest ok = yes
      create mask = 0664
      directory mask = 0775

      [Music]
      path = /home/matt/Music
      browseable = yes
      read only = no
      guest ok = yes
      create mask = 0664
      directory mask = 0775

      After saving, make sure each folder is readable from the network:

      chmod o+rx /home/matt
      chmod -R o+rx /home/matt/Videos /home/matt/Music

      Then restart Samba: sudo systemctl restart smbd

      Test from another device with: smbclient //YOUR-IP/Videos -N -c ‘ls’

      Reply

Leave a Comment

Press ESC to close