this post was submitted on 14 Oct 2025
14 points (93.8% liked)

Linux

58970 readers
1339 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

EDIT: I've accepted that the tutorial I was trying to follow is incomplete or incorrect. I've successfully accessed my new samba share after creating a user on the host machine and updating smb.conf. I must authenticate to access the share, and I'm fine with that, so I'm calling this thread "Resolved." I want to thank everyone who chimed in in the comments. Feel free to keep the discussion going for anyone else who stumbles upon this thread.

Here are my final notes on this subject:

  • Install samba packages: sudo apt update && sudo apt install samba
  • Confirm smbd is running: sudo systemctl status smbd
  • Create a dedicated folder for the share: sudo mkdir /mnt/ShareDemo
  • Create a new user and set the password for Linux: sudo adduser shareuser
  • Add the new user for Samba using the same password: sudo smbpasswd -a shareuser
  • Change ownership of the ShareDemo folder: sudo chown -R shareuser:shareuser /mnt/ShareDemo
  • And change its permissions to 0775: sudo chmod -R 0775 /mnt/ShareDemo
  • Update firewall rules to allow access: sudo ufw allow samba
  • Add the share definition to the end of /etc/samba/smb.conf as follows:
[ShareDemo]
   path = /mnt/ShareDemo
   valid users = shareuser
   public = no
   writable = yes
   browseable = yes

I'm not sure if restarting the smbd is necessary, but if it is, here's how to do that: sudo service smbd restart

On another device on the same network, we should now be able to find and access this shared folder in the Network section of our file browser of choice and authenticate using shareuser.

ORIGINAL POST:

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.conf as 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!

you are viewing a single comment's thread
view the rest of the comments
[–] hendrik@palaver.p3x.de 1 points 1 day ago* (last edited 1 day ago) (1 children)

I think they want you to add something like

guest ok = yes  

Isn'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...

[–] yo_scottie_oh@lemmy.ml 2 points 1 day ago

I got into my new network share, albeit not anonymously, but that's okay. Thanks for chiming in.