Why you can trust ZDNET
:ZDNET independently tests and researches products to bring you our best recommendations and advice. When you buy through our links, we may earn a commission.Our process
'ZDNET Recommends': What exactly does it mean?
ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other relevant and independent reviews sites. And we pore over customer reviews to find out what matters to real people who already own and use the products and services we’re assessing.
When you click through from our site to a retailer and buy a product or service, we may earn affiliate commissions. This helps support our work, but does not affect what we cover or how, and it does not affect the price you pay. Neither ZDNET nor the author are compensated for these independent reviews. Indeed, we follow strict guidelines that ensure our editorial content is never influenced by advertisers.
ZDNET's editorial team writes on behalf of you, our reader. Our goal is to deliver the most accurate information and the most knowledgeable advice possible in order to help you make smarter buying decisions on tech gear and a wide array of products and services. Our editors thoroughly review and fact-check every article to ensure that our content meets the highest standards. If we have made an error or published misleading information, we will correct or clarify the article. If you see inaccuracies in our content, please report the mistake via this form.
Samba is a great way to share folders from your Linux desktop with other users on your network. For example, you might have documents that others need to access -- or perhaps you have photos, video, or just about any type of file to share. Samba makes it possible to share those files and folders to any device on your network and do so with a required username and password.
I've already explained how Samba can be set up in this way. But this time around I want to demonstrate how you can create a share that doesn't require a username or password for users to access, so you can make those files available to anyone connected to your network.
One thing to keep in mind is that you should never share files with sensitive information in this way. For those types of files you want to ensure your shares are set up for authentication; otherwise, that sensitive information could wind up in the wrong hands. In other words, use caution when doing this.
Before you jump into creating the guest folder, make sure to read through the piece linked above, so you can get Samba installed and understand how it works. In that piece, you create a password-protected share that can only be accessed by those who have accounts on the machine sharing the directory.
Once you're familiar with Samba, it's time to create the guess-accessible directory.
How to create your guest share with Samba
What you'll need: To make this work, you'll need a Linux machine running Samba and a user with sudo privileges. That's it. Let's get to work.
1. Create a new directory
The first thing we'll do is create the directory that will house the files/folders accessible by guests on your network. To do that, open your terminal window and issue the following command:
sudo mkdir /home/share
2. Give the folder the proper permissions
We now must change the permissions for the folder, such that anyone can access it with the command:
3. Open the Samba configuration file
Next, we need to open the Samba configuration file with the following command:
Since we're making this share available to anyone, we want to lock down Samba such that it's only accessible from your internal network. To do this, you must change two lines. Before doing this, you must locate the name associated with your network interface, which can be done with the command:
You should see a name for that interface, such as enp0s3.
The first thing you must change is this:
; interfaces = 127.0.0.0/8 eth0
Change that to:
interfaces = 127.0.0.0/8 NAME
Where NAME is the name of your network interface.
Next, locate the following line:
; bind interfaces only = yes
Change that to:
bind interfaces only = yes
5. Add the share
At the bottom of the smb.conf file, add the following:
path = /home/share
public = yes
guest only = yes
writable = yes
force create mode = 0666
force directory mode = 0777
browseable = yes
The above configuration defines the path to the share; makes it public, guest only, and writable; sets the permission mode for file creation and directories; and makes it browsable.