[Samba] I want to set file/folder permissions to 777, but I can't.

Se Na fujisansunnyday at gmail.com
Fri May 27 11:22:21 UTC 2022


Thank you for your reply

2022年5月27日(金) 18:10 Rowland Penny via samba <samba at lists.samba.org>:

> On Fri, 2022-05-27 at 16:59 +0900, SN via samba wrote:
> > Nice to meet you.
> > My name is Naka.
> >
> > This is my first time to participate.
> >
> > I look forward to working with you.
> >
> > Now, I'd like to ask
> >
> > I'm using RockyLinux 8.6, and I've found
> > baseos repositories.
> > Samba Version 4.15.5
> > in the baseos repository on RockyLinux8.6.
> >
> > In addition, we have also added the
> > in the epel-testing repository.
> > netatalk-3.1.13-3
> > also used, and
> > Windows 10 and MacOSX 10.9.5 can see the same volume.
> >
> >
> > My question is.
> > From MacOSX10.9.5, can I create folders and files via
> > When I create a folder or file via Samba
> > I get the following access rights
> >
> > drwxr-xr-x+ 2 nobody nobody 4096 May 27 11:17 test
> > -rw-r--r--+ 1 nobody nobody 4 May 27 11:18 test.txt
>
> Try 'getfacl' to read the permissions.
>

I tried it.

[root at AMULET3 A3-Linux]# getfacl test
# file: test
# owner: nobody
# group: nobody
user::rwx
user:nobody:rwx #effective:r-x
group::rwx #effective:r-x
group:nobody:rwx #effective:r-x
mask::r-x
other::r-x

[root at AMULET3 A3-Linux]# getfacl test.txt
# file: test.txt
# owner: nobody
# group: nobody
user::rw-
user:nobody:rw- #effective:r--
group::r--
group:nobody:r--
mask::r--
other::r--

>
> >
> >
> > By the way
> > For your information, in a guest connection, the
> > I think I have set the access rights to be 777.
> >
> > Originally, I would have set
> > drwxrwxrwx (folder)
> > -rwxrwxrwx (file)
> > I think it should be -rwxrwxrwxrwx (folder).
>
> No, the 'd' states that it is a directory and the 'rwx' set on on
> user/group/others means that it is a wide open directory.
>

I'm sorry.
I'm using a Mac, so I just wrote "folder".
I understand you mean directories.


>
> >
> > Is there something wrong with my configuration?
>
> Yes and no, you have a few defaults set and a couple I see no point to
> (the 'logon' ones), but nothing really wrong, I suggest you run
> 'testparm -s'.
>

I ran it.

[root at AMULET3 ~]# testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed

Server role: ROLE_STANDALONE

# Global parameters
[global]
dos charset = CP932
interfaces = 127.0.0.1/8 192.168.24.0/24
log file = /var/log/samba/log.%m
logging = file
logon home = \%N\%U
logon path = \%N\%U\profile
map to guest = Bad User
max log size = 1000
panic action = /usr/share/samba/panic-action %d
security = USER
server role = standalone server
server string = A3 SMB Server
unix charset = UTF8
unix extensions = No
usershare allow guests = Yes
usershare max shares = 100
workgroup = WINWORKGROUP
idmap config * : backend = tdb
delete veto files = Yes
guest ok = Yes
hide files = /.AppleDB/.AppleDouble/.AppleDesktop/Network Trash
Folder/TheFindByContentFolder/TheVolumeSettingsFolder/Temporary
Items/.TemporaryItems/.VolumeIcon.icns/Icon?/.FBCIndex/.FBCLockFolder/:2eES_Store/.DS_Store/.Trashes/..Trashes
level2 oplocks = No
map acl inherit = Yes
map archive = No
oplocks = No
veto files = /lost+found/
wide links = Yes


[A3-Linux-SMB]
force create mode = 0777
force directory mode = 0777
guest only = Yes
path = /home2/A3-linux-doc/A3-Linux
read only = No
vfs objects = catia fruit streams_xattr recycle
streams_xattr:store_stream_type = no
streams_xattr:prefix = user.
fruit:encoding = native
fruit:locking = netatalk
fruit:metadata = netatalk
fruit:resource = file


[A3-MacWin-SMB]
force create mode = 0777
force directory mode = 0777
guest only = Yes
path = /home2/A3-linux-doc/A3-MacWin
read only = No
vfs objects = catia fruit streams_xattr recycle
streams_xattr:store_stream_type = no
streams_xattr:prefix = user.
fruit:encoding = native
fruit:locking = netatalk
fruit:metadata = netatalk
fruit:resource = file



>
> Rowland
>
>
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba


Some have noted the following
What do you think?

/etc/samba/smb.conf
The permissions seem to be determined by the umask after the create mask
and force create mode processes set in /etc/samba/smb.conf are performed.
I think that changing the umask and restarting smbd will do what I expect.
I changed the umask in /etc/login.defs, but it might be better to change it
in profile or something.


More information about the samba mailing list