Skip to content
Follow
Ubuntu Linux

How to Create a Samba Public Share on Ubuntu 24.04

Richard
Written by
Richard
Feb 26, 2025 Updated Jul 13, 2026 4 min read
How to Create a Samba Public Share on Ubuntu 24.04
How to Create a Samba Public Share on Ubuntu 24.04

Creating a Samba public share on Ubuntu 24.04 lets anyone on your network access files without a password.

Samba is a free program that lets Windows and Linux computers easily share files and printers using the SMB/CIFS protocol.

This means you can pick a folder, like one in your home folder, and let others read and write files there freely. We will set up Samba on your Ubuntu 24.04 to make this happen.

⚡ Quick Answer

Install Samba using `sudo apt install samba`, create a share folder with `sudo mkdir /home/share` and `sudo chmod 777 /home/share`, then configure `/etc/samba/smb.conf` with guest access enabled and restart Samba with `sudo systemctl restart smbd`.

Install Samba

⚠️Warning
To use Samba on Ubuntu, you must install its packages. It is not available on Ubuntu by default.

Run the command below to install Samba.

🐧Bash / Shell
sudo apt update
sudo apt install samba

Create a share folder

After installing Samba, create the folder you wish to share with everyone. If you have an existing folder, then skip this section.

⚠️Warning
The folder (share) below will be a fully public share with everyone having access without requiring authentication.
🐧Bash / Shell
sudo mkdir /home/share
sudo chmod 777 /home/share

Configure Samba

To configure your Samba public share on Ubuntu 24.04, you need to edit the main Samba settings file, which is located at /etc/samba/smb.conf. This file controls how your shared folders work, who can access them, and what they can do. It’s a good idea to make a copy of this file before you start changing anything, just in case.

Samba default configuration file is at [/etc/samba/smb.conf].

First, create a backup before editing it.

🐧Bash / Shell
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Then edit the file and adjust the highlighted settings below.

🐧Bash / Shell
sudo nano /etc/samba/smb.conf

Adjust the settings below.

💻Code
#======================= Global Settings =======================

[global]

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

#### Networking ####

# Uncomment and add your interface name

interfaces = 127.0.0.0/8 ens33

# Uncomment this to bind to the named interfaces and/or networks

bind interfaces only = yes


####### Authentication #######
#
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections

map to guest = bad user

#======================= Share Definitions =======================
#
# Under share definitions, create your share with the folder above.

[Share]
# specify shared directory
path = /home/share
# allow all to write
writable = yes
# allow guest user (nobody)
guest ok = yes
# consider all as guest
guest only = yes
# set all new files to public
force create mode = 777
# set all new folers to public
force directory mode = 777

Save and exit the file.

Restart Samba.

🐧Bash / Shell
sudo systemctl restart smbd

Samba share is created. Users on the same network should be able to browse and locate the shared folder.

Map Samba shares on Windows

Mapping your Samba shares on Windows makes it super easy to get to your Ubuntu files right from File Explorer, like they’re just another drive on your PC. You can map a Samba share by right-clicking the Network folder in File Explorer and picking ‘Map network drive’, then typing in your Ubuntu server and share details.

Right-click the Network folder in File Explorer and select “Map network drives.”

Map network drives Windows 11
Map network drives Windows 11

Enter the server name followed by the share name.

💻Code
\srv1.example.comshare
Map network drives Windows 11 shares
Map network drives Windows 11 shares

When prompted, enter your account that lives on the Ubuntu server.

Map network drives Windows 11 account
Map network drives Windows 11 account

After that, the share should be mapped to your Windows machine.

Map network drives Windows 11 complete
Map network drives Windows 11 complete

The latest version of Windows 11 will block unauthenticated guest access by default. A workaround is below to allow authenticated guest access.

Microsoft document:

  • Select Start, type gpedit.msc, and select Edit group policy.
  • In the left pane under Local Computer Policy, navigate to Computer ConfigurationAdministrative TemplatesNetworkLanman Workstation.
  • Open Enable insecure guest logons, select Enabled, then select OK.

Disable SMB signing as well.

Microsoft document:

Open the Local Group Policy editor.

Expand Windows Settings > Security Settings > Local Policies and select Security Options.

Then, select “Microsoft network client: Digitally sign communication (always)” and disable it.

Disabling SMB signing in Samba configuration on Ubuntu
Disabling SMB signing in Samba configuration on Ubuntu

That should do it!

Conclusion:

Setting up a Samba public share on Ubuntu 24.04 allows for seamless file and print sharing across your network. Here are the key points to remember:

  • Samba Installation: Ensure Samba is installed to enable sharing capabilities.
  • Folder Creation: Create and set permissions for a public share directory.
  • Configuration: Modify the Samba configuration file to establish guest access and appropriate permissions.
  • Restart Service: Always restart the Samba service after making configuration changes.
  • Windows Mapping: Windows users can easily map the shares but may need to enable guest access settings due to security features.
  • Security Considerations: Be aware of potential security implications when allowing unauthenticated guest access.

With these steps, your Samba share will be ready for use, offering a convenient solution for file sharing within your network.

section by specifying the path, setting 'writable = yes', and allowing guest access with 'guest ok = yes'. Make sure to set the file and directory modes to 777 for public access.”]

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Map Local Folders as Drives in Windows 11
Windows How to Map Local Folders as Drives in Windows 11
How to Enable File Sharing Between Ubuntu and Windows 11
Windows How to Enable File Sharing Between Ubuntu and Windows 11
How to Enable File and Printer Sharing in Windows 11
Windows How to Enable File and Printer Sharing in Windows 11
How to Map Shared Folders in VirtualBox on Windows 11
Windows How to Map Shared Folders in VirtualBox on Windows 11

1 Comment

Leave a Comment

Your email address will not be published. Required fields are marked *