Background: I’m attempting to set up a public samba share on my local network following this tutorial on thelinuxcode.com. Long term, I’ll probably set up some security around this, but for now I just want to confirm I can follow a basic tutorial. Unfortunately, so far, I’m failing.
What I’ve done so far (on the host machine):
- Installed samba packages:
sudo apt update && sudo apt install samba - Confirmed smbd is running:
sudo systemctl status smbd - Created a dedicated folder for the share:
sudo mkdir /mnt/ShareDemo - Changed ownership of the ShareDemo folder to
nobody:nogroup:sudo chown -R nobody:nogroup /mnt/ShareDemo - And changed its permissions to
0775:sudo chmod -R 0775 /mnt/ShareDemo - Added the share definition to
/etc/samba/smb.confas follows:
[ShareDemo]
path = /mnt/ShareDemo
valid users = @users
force user = nobody
force group = nogroup
public = yes
writable = yes
browseable = yes
- Updated firewall rules to allow access:
sudo ufw allow samba
As far as I can tell, I’ve followed the instructions exactly as described in the tutorial. According to the tutorial, my newly created Samba share should now be accessible from any Windows, macOS, or Linux device on the same local network. On Linux:
- Install samba-client if you haven‘t already -> DONE.
- Open your file manager and click “Other Locations” or “Network” -> DONE.
- Browse for your Ubuntu hostname and click the share folder -> DONE.
- It will mount automatically without any login prompt needed -> this is where I’m stuck. I’ve tested this on two different Linux devices on my local network. In both cases, the samba share shows up in the file manager, but the system prompts me to authenticate and I cannot proceed as an anonymous user.
Even though the tutorial doesn’t specifically say I need to, I’ve tried restarting smbd after updating smb.conf, but I still have the same issue.
What have I done wrong? Is the tutorial missing a step or simply outdated? Is there another tutorial that I should follow instead? Thanks in advance!
It’s not just a config thing, you need the local guest user and an smbpasswd entry to match: https://serverfault.com/questions/630631/how-to-make-samba-share-to-not-ask-for-password#632296
This helped, thank you!
What has me scratching my head is that in the tutorial I was reading from, it mentions setting up users but very explicitly labels that section as “Optional.” Anyway, I got in after following the instructions in that paragraph - adding a Linux and Samba user called
shareuserand updating the config. Unlike in the tutorial, I keptbrowseable = yesso that I can still browse to the folder in my file manager.valid users = shareuser public = no writable = yes browseable = yesIt’s a good lesson to learn if you’re working with Samba frequently. Just always that there are two auth systems at work: SMB local to the server and filesystem, and the SMB protocol auth that does network access.
👍
You are being prompted because the nobody/nogroup user/group has no password, no shell, and no permissions.
That tutorial is wrong. Couple of problems immediately:
- “valid users” specifies “all the users in this group are allowed access”. It is incompatible with “force user/group” directive
- you should be using the “guest user=” directive, which sets the identity of any public access. Your permissions should match this user.
- nobody/nogroup are special user and group that (usually) have no access to any file. They exist for processes to run with minimal provileges, or for a fallback default if UID/gid map are invalid. Using this user/group combo for this samba share implies that you will either alter them so that they now DO have privileges to access files, or that you intend samba to never access any files. Create a guest user, set permissions and umask in the directory.
Gotcha. FWIW I got in after following the instructions in the “Optional” paragraph about setting up users for authentication - I added a Linux and Samba user called
shareuser, set the new user as the owner of/mnt/ShareDemo, and updated the config.Thanks for confirming my suspicion. This was really going to eat at me if nobody else chimed in, so you really saved me from questioning my own sanity.
It smells of AI generation. Real people don’t write this kind of article like that. I’d bet they said “write a comprehensive 2500+ word guide to install and configure samba on linux”.
Edit: the site logo is definitely AI generated, and the T&C page was also generated. This whole site is slop.
I agree.
I’m getting bored with the AI influence on everything. And now this poor person has been led down the garden path with that silly article.
guest/guest? I think you’re misunderstanding public.
Sorry, I’m trying to understand your comment. Are you suggesting I put something else in place of
nobody:nogroupwhen I set ownership of the ShareDemo folder, or is the issue that I have to actually create a user callednobodyand a group callednogroup? Or should I create a different user and group specifically for this samba share? Thanks.I think they want you to add something like
guest ok = yesIsn’t there some example config installed along with samba, which you can modify or copy-paste? I think that’s more likely to be laid out correctly than a random internet tutorial which might be outdated or for another distro or another use-case…
I got into my new network share, albeit not anonymously, but that’s okay. Thanks for chiming in.
It’s been a few years (like 20) give me an hour or two to get a few things done and I’ll have a look.
I was suggesting that a public share might not mean anonymously accessible. You may need to authenticate, some OSes will try to do that for you, some won’t.
I was suggesting attempting to mount the share with a login and password of guest.
Gotcha - thanks for clarifying. I tried logging in w/ login and password of guest, but that didn’t work, either. FWIW I successfully authenticated after following the “optional” part of the tutorial (created a new user
shareuser, made it the owner of/mnt/ShareDemo, and updatedsmb.conf).Based on non_burglar’s and frongt’s comments, I think I’m willing to file this experience under either incomplete or incorrect tutorial. Importantly, I have learned something about setting up a local Samba share, so I thank you for helping me.
One nit to pick for anyone who reads this later.
/srvis probably a more appropriate location than/mnt./srvis for local data services are going to serve.


