Edit the samba configuration file.

sudo nano /etc/samba/smb.conf

Add this to the end of the file:

[Public Directory]
comment = Contents are read/write by all.
path = /home/user/directory-to-be-shared
read only = no
guest ok = yes
create mask = 0666
force create mode = 0666
directory mask = 0777
force directory mode = 0777

Then restart samba.

sudo service smbd restart

Notes:

  1. The string within brackets (Public Directory in the example above) is what users will see when accessing the shared folder from other systems.
  2. Files created within this directory by users on other systems will be owned by nobody:nogroup, with read and write permissions for owner, group, and other.
  3. Directories created in this directory by users on other systems will be owned by nobody:nogroup, with read, write, and directory traversal permissions for owner, group, and other.
  4. The masks and modes in the configuration file apply to files and directories created by users on other systems. These masks and modes are ignored when creating files as a user on the server. Or, to put it another way, if you are user on the server, make sure that each file and directory that you create within /home/user/directory-to-be-shared has 666 and 777 permissions respectively.
  5. If you have enabled a firewall on the server, you will need to open port 445 for tcp. For example, if you use ufw (uncomplicated firewall) to configure the firewall:

    sudo ufw allow in 445/tcp
    sudo ufw reload
    sudo ufw status verbose
    
Answer from TooManyPets on askubuntu.com
🌐
Ubuntu
documentation.ubuntu.com › server › how-to › samba › share-access-controls
Share access controls - Ubuntu Server documentation
2 weeks ago - For example, if you wished to use a group named sysadmin in a certain section of the /etc/samba/smb.conf, you would do so by entering the group name as @sysadmin. If a group name has a space in it, use double quotes, like "@LTS Releases". Read and write permissions define the explicit rights a computer or user has to a particular share.
🌐
OneUptime
oneuptime.com › home › blog › how to configure samba share permissions on ubuntu
How to Configure Samba Share Permissions on Ubuntu
March 2, 2026 - Before configuring Samba, ensure the Linux filesystem permissions are correct: # Create the share directory sudo mkdir -p /srv/samba/department # Set ownership: owned by root, group access for the 'finance' group sudo chown root:finance /srv/samba/department # Set permissions: # Owner (root): rwx # Group (finance): rwx # Others: --- sudo chmod 770 /srv/samba/department # Set the setgid bit so new files inherit the group sudo chmod g+s /srv/samba/department # Verify ls -la /srv/samba/ # drwxrws--- root finance /srv/samba/department
Discussions

How to create a Samba share that is writable from Windows without 777 permissions? - Unix & Linux Stack Exchange
I have a path on a Linux machine (Debian 8) which I want to share with Samba 4 to Windows computers (Win7 and 8 in a domain). In my smb.conf I did the following: [myshare] path = /path/to/share wri... More on unix.stackexchange.com
🌐 unix.stackexchange.com
File Permission Issues With SMB Server on Ubuntu 20.04
In your smb.conf set the create mask to 0777 or security level to share. As others have mentioned depending on your use case this can be a very bad idea so it’s not recommended for most use cases. More on reddit.com
🌐 r/storage
6
5
June 19, 2021
Questions about file permissions and its relationship to Samba file sharing
I think this is where Windows really has the advantage, folder permissions (especially with groups) are much easier to manage, especially when things get a bit more complex. On my Linux NAS, I finally relented and just made sure everything got the same permissions. Given that it's only me and the gf accessing the NAS that's totally fine for us. Lastly, when my wife adds new music, it sounds like it's going to be added with her as the owner and group. How do I change that, or do I even need to? smb.conf has a couple of directives for that: force user = username force group = groupname force create mode = 770 force directory mode = 770 More on reddit.com
🌐 r/HomeServer
6
1
August 21, 2021
Samba write permissions
You do not set up write privilege for Samba, you set up permissions for the user and you do it on the server, how you do this will, to a certain extent, depend on how you are running Samba. It will help if you can post the output of 'testparm -s' from the Samba server. More on reddit.com
🌐 r/linuxquestions
9
1
September 20, 2024
Top answer
1 of 2
4

Edit the samba configuration file.

sudo nano /etc/samba/smb.conf

Add this to the end of the file:

[Public Directory]
comment = Contents are read/write by all.
path = /home/user/directory-to-be-shared
read only = no
guest ok = yes
create mask = 0666
force create mode = 0666
directory mask = 0777
force directory mode = 0777

Then restart samba.

sudo service smbd restart

Notes:

  1. The string within brackets (Public Directory in the example above) is what users will see when accessing the shared folder from other systems.
  2. Files created within this directory by users on other systems will be owned by nobody:nogroup, with read and write permissions for owner, group, and other.
  3. Directories created in this directory by users on other systems will be owned by nobody:nogroup, with read, write, and directory traversal permissions for owner, group, and other.
  4. The masks and modes in the configuration file apply to files and directories created by users on other systems. These masks and modes are ignored when creating files as a user on the server. Or, to put it another way, if you are user on the server, make sure that each file and directory that you create within /home/user/directory-to-be-shared has 666 and 777 permissions respectively.
  5. If you have enabled a firewall on the server, you will need to open port 445 for tcp. For example, if you use ufw (uncomplicated firewall) to configure the firewall:

    sudo ufw allow in 445/tcp
    sudo ufw reload
    sudo ufw status verbose
    
2 of 2
2

It's not clear to me if you want a share accessible to everyone or only a group of client users so this is a template for the latter.

Note: This will only work as described if the default umask of your system is 0002 so it will not work for Ubuntu Desktop 17/18 but it will work for Xubuntu Desktop and Ubuntu Server.

In this template it is required that all users you want to have access become members of the "users" group. It will assign the setgid bit on the shared directory and any future subdirectories which forces anything new added to them to inherit the group of it's parent folder.

sudo mkdir /path
sudo chown root:users /path
sudo chmod 2775 /path

The share would look like this:

[UsersShare]
path = /path
valid users = @users
force group = users
read only = no
create mask = 0664
force directory mode = 2775

When bob - who was made a member of the "users" group - logs in with his samba username/password and adds a file to the [UsersShare] share it will have owner = bob, group = users, mode = 664 files / 2775 folders.

All other client users who are members of the users group who sign in will have full access to whatever bob did.

Any local users - those on the server itself - who add or modify files who are also members of the users group will all have the same ability and newly created files/folders will have the same 664/2775 mode and all will have as group: "users". The one exception to all this is root - as in when you use sudo - since it's default umask is 022 unlike a regular user his files will inherit the "users" group but will have a mode of 644.

If you truly want a pure public share where everyone has access replace "valid users = @users" with "guest ok = yes". For this to work locally on the server you would still need to add those users to the "users" group.

Top answer
1 of 1
1

Will i need to use winbind and kerberos?

Most likely not. The Samba fileserver provides the same features regardless of where the accounts come from – your local Samba accounts are already automatically associated with the corresponding OS accounts, etc.

(However, Active Directory would be a good idea if you have more than 3-4 servers.)

Who should be the owner of the shared folders?

Doesn't really matter; root would be a good choice if there's no specific owner otherwise.

If set create mask, directory mask to 755 do i have to change the directory permission with chmod?

Depends on situation, but most likely "yes".

Samba's "create/directory mask" settings do not change existing permissions; they only specify what will be used for new files created on that share. If you want to make a public share but the directory currently has permissions 0700 – Samba won't change that; you have to chmod it yourself.

Will the 755 permission work or is should change?

It's the standard "readable by others" permission. It doesn't really match your descriptions though – for home directories it'd grant too much (unnecessary 'read/execute' for others); for shared directories it'd grant too little (missing 'write' for others); so you probably need to change it in both cases.

If someone downloads a file via transmission can the user be the owner instead of transmission?

Only if the users run their own Transmission instances (each on its own port number).

As Transmission is a local process, it is unaffected by SMB server configuration – all files it creates will be owned by the account that Transmission itself runs as.

Disable the system-wide Transmission service, then create a "user-level" transmission.service in /etc/systemd/user/, which each user could start using systemctl --user. (There are some differences in what settings to use, but those are already documented elsewhere.)

Don't forget to use loginctl enable-linger to allow the users' personal services start on boot (by default they're limited to login—logout, but the "linger" mode avoids that).

🌐
nixCraft
cyberciti.biz › nixcraft › tutorials › debian linux › samba share permissions simplified
Samba share permissions simplified - nixCraft
January 5, 2007 - It is to do with the linux permissions ... in the samba share, right click on the folder -> properties -> permissions · under group and folder access this had defaulted to none · change to create and delete files and apply permissions to enclosed ...
🌐
Super User
superuser.com › questions › 1707541 › how-to-set-permissions-in-samba-ubuntu-20-04
how to set permissions in SAMBA Ubuntu 20.04 - Super User
March 1, 2022 - the best fix I've found for this, is to put the users in a group, set the existing directories to be owned by that group, and use SetGID to ensure that all users of the group get the permissions of the parent directory for new files/dirs. combine ...
🌐
Ubuntu
ubuntu.com › server › docs › samba-share-access-control
Share access controls
March 1, 2023 - You should have been redirected · If not, click here to continue
Find elsewhere
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-set-up-a-samba-share-for-a-small-organization-on-ubuntu-16-04
How To Set Up a Samba Share For A Small Organization on Ubuntu 16.04 | DigitalOcean
May 11, 2018 - Setting the permissions of the directory to 2770 means that new files or directories created under /samba/david/ will inherit the group ownership of the parent directory rather than the primary group of the user that created the file or directory. This means, for example, that if the admin user were to create a new directory in david’s share, david would be able to read and write to it.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
[SOLVED] SAMBA, shared folder permissions - Linux Mint Forums
May 20, 2023 - Edit /etc/samba/smb.conf Right under the workgroup = WORKGROUP line towards the top of the file add this line: ... altair4 wrote: Sun Jul 17, 2022 7:00 am Part 3: Creating a Samba Share from Nemo Ubuntu changed the default permissions on home folders from 755 to 750 so only the owner of the ...
🌐
Ask Ubuntu
askubuntu.com › questions › 1351901 › how-to-set-up-samba-user-permissions
networking - How to set up SAMBA user permissions? - Ask Ubuntu
The rest (user3-4-5) can acces the whole content also, but with read-only permissions. However there are some directory (ex. theirs private dirs) which are readable/writeable for them too. To make this idea more understandable, I created a directory map, where green dir = read/write and red dir = read-only: ... [My shared folder] path = /media/my/shared/folder read only = no read list = user3 user4 user5 browseable = yes hosts allow = ip1 ip2 ip3 ip4 ip5 hosts deny = 0.0.0.0/0 valid users = user1 user2 user3 user4 user5 max connections = 5
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
Changing permissions on Samba shares [SOLVED] - Linux Mint Forums
The system creates special permissions on the /media/bill folder that limits access to "bill" only. The "guest" is not bill so access is denied. You can force the client users to access the share as bill. Or you can make all your clients "appear" to be bill by doing this - on the server.: Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line towards the top of the file add this one:
Top answer
1 of 5
103

I recommend to create a dedicated user for that share and specify it in force user(see docs).

Create a user (shareuser for example) and set the owner of everything in the share folder to that user:

adduser --system shareuser
chown -R shareuser /path/to/share

Then add force user and permission mask settings in smb.conf:

[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser

Note that guest ok is a synonym for public.

2 of 5
6

In the share settings in smb.conf, you'll need to specify the names of users and/or groups that are allowed to write to the share, using a write list = ... line.

Example:

[myshare]
...
write list = my_linux_username

Then you'll need to use the smbpasswd command to set up a password to authenticate my_linux_username for Samba:

sudo smbpasswd -a my_linux_username

This step is necessary because the standard system passwords in /etc/shadow are hashed in algorithms that are incompatible with the password hash algorithms used in the SMB protocol. When a client sends a SMB authentication packet, it includes a hashed password. It can only be compared to another password hash that uses the same algorithm.

(Very, very old instructions from the previous millennium may recommend disabling password encryption in Samba, and using certain registry hacks to allow Windows to emit unencrypted passwords to the network. This advice is obsolete: those registry hacks may no longer work in current versions of Windows, and allow anyone who can monitor your network traffic to trivially capture your password.)


There's one more thing you may have to do client-side. When your Windows client system is joined to an Active Directory domain and you're logged in with an AD account, it automatically prefixes all unqualified usernames with the name of the AD domain of the user, i.e. you will be authenticating as AD_DOMAIN\your_username, not just your_username.

If you are logged in with a local account (or your client system is not joined to an AD domain), Windows may automatically prefix the username with the client hostname unless you specify another domain name.

To successfully log in to a stand-alone Samba server from a stand-alone Windows client, you may have to specify your username as SAMBA_SERVER_HOSTNAME\your_username.

Otherwise Samba will see the username as WINDOWS_CLIENT_HOSTNAME\your_username, conclude that it has no way to verify any users belonging to domain named WINDOWS_CLIENT_HOSTNAME, and will reject the login.

(Newer versions of Samba may have a built-in check for this specific situation, and they might allow you access nevertheless. But this is basically how SMB authentication works "under the hood", and if you need to deal with old versions of Samba, it might be useful still.)

🌐
Ask Ubuntu
askubuntu.com › questions › 1240240 › samba-share-permissions
Samba Share Permissions - Ask Ubuntu
May 16, 2020 - You didn't specify how you created the shares: in smb.conf itself or via Nautilus > Local Network Share so you can add a line in the [global] section - like right under workgroup = WORKGROUP - replacing cpw7922 with your local ubuntu user name:
🌐
StudyVatika
studyvatika.com › blogs › setting-up-samba-shares-with-user-specific-permissions-a-complete-guide-for-schools-and-organizations
Setting Up Samba Shares with User-Specific Permissions: A Complete Guide for Schools and Organizations | StudyVatika Blog
September 3, 2025 - After diving deep into Samba documentation and testing various approaches, I found the perfect combination using the sticky bit feature and careful Samba configuration. Here's the step-by-step breakdown: First, let's create our users and set up the shared folder: # Create user accounts sudo useradd admin sudo useradd student # Create the shared directory sudo mkdir -p /home/server/school_drive # Set ownership to admin sudo chown admin:admin /home/server/school_drive # Set basic permissions sudo chmod 770 /home/server/school_drive # Here's the magic - set the sticky bit sudo chmod +t /home/server/school_drive
🌐
Reddit
reddit.com › r/storage › file permission issues with smb server on ubuntu 20.04
r/storage on Reddit: File Permission Issues With SMB Server on Ubuntu 20.04
June 19, 2021 -

I have a network share hosted on an Ubuntu 20.04 server. I've set up the server properly and the client computers can upload files to the SMB share but unfortunately, the files are locked on the host computer. I can change the files using chmod -R 777 but any new files do not follow the same permissions.

Is there any way to make it where the folder's permissionless - where anyone with access can treat their files as their own and without having to run that command every 5 minutes?

Any help would be greatly appreciated. I will even throw in some beautiful Reddit Gold karma for the first answer that works :)

Edit: Thanks for the help everyone

🌐
Samba
samba.org › samba › docs › using_samba › ch09.html
Samba
Here are the Unix commands that create the shared directory for the accounting department (assuming /home/samba already exists): # mkdir /home/samba/accounting # chgrp account /home/samba/accounting # chmod 770 /home/samba/accounting · There are two other options in this smb.conf example, both of which we saw in the previous chapter. These options are create mode and directory mode. These options set the maximum file and directory permissions that a new file or directory can have.