You are not logged in.

#1 2017-08-03 19:29:25

neutronst4r
Member
Registered: 2016-02-25
Posts: 31

Samba guest (read only) requires write permission on file system

Hello,
I am trying to configure a samba server and I want setup a folder for guests (read only) and certain named users (write access). Both things work right now, but the former only does so when I set the file system permissions to include write  permission for all users, even though I only want read access for all. Below is my smb.conf file:

[global]
    workgroup = WORKGROUP
    hosts allow = 127.0.0.1, 192.168.178.1/24
    hosts deny = 0.0.0.0/0
    log file = /var/log/samba/%m.log
    max log size = 50
    security = user
    guest account = nobody
    encrypt passwords = true

[RR-Videos]
    comment = Video Share
    path = /RR/Videos
    browseable = yes
    guest ok = yes
    read only = yes
    write list = @neutronst4r

I can access the server using:

smbclient -U nobody //rick/RR-Videos

However, I have no read rights (trying ls) and when I try to mount the share I get the following error:

/home/neutronst4r neutronst4r@archy% sudo mount -v -t cifs -o guest //rick/RR-Videos /RR 
[sudo] password for neutronst4r: 
mount.cifs kernel mount options: ip=192.168.178.49,unc=\\rick\RR-Videos,user=,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Mounting does work, if I give all write permission on the file system. Guests still can't write, because the samba rule is still read only, but I don't really want to set those file permissions unless absolutely neccessary. Permissions on /RR are:

/home/neutronst4r neutronst4r@rick% ls -l /
total 53
drwxrwxr--   5 neutronst4r neutronst4r  4096 Aug  3 11:44 RR

Thank you for your help in advance!

I did read the whole chapter in the documentation and there is nothing about file permissions for guests.

Last edited by neutronst4r (2017-08-03 19:33:37)


makepkg not war

Offline

#2 2017-08-04 02:24:39

swatquest
Member
Registered: 2013-01-07
Posts: 30

Re: Samba guest (read only) requires write permission on file system

You can try
Add the permission parameter
https://www.samba.org/samba/docs/man/ma … onf.5.html

 create mask (S)

    When a file is created, the necessary permissions are calculated according to the mapping from DOS modes to UNIX permissions, and the resulting UNIX mode is then bit-wise 'AND'ed with this parameter. This parameter may be thought of as a bit-wise MASK for the UNIX modes of a file. Any bit not set here will be removed from the modes set on a file when it is created.

    The default value of this parameter removes the group and other write and execute bits from the UNIX modes.

    Following this Samba will bit-wise 'OR' the UNIX mode created from this parameter with the value of the force create mode parameter which is set to 000 by default.

    This parameter does not affect directory masks. See the parameter directory mask for details.

    Default: create mask = 0744

    Example: create mask = 0775 
directory mask (S)

    This parameter is the octal modes which are used when converting DOS modes to UNIX modes when creating UNIX directories.

    When a directory is created, the necessary permissions are calculated according to the mapping from DOS modes to UNIX permissions, and the resulting UNIX mode is then bit-wise 'AND'ed with this parameter. This parameter may be thought of as a bit-wise MASK for the UNIX modes of a directory. Any bit not set here will be removed from the modes set on a directory when it is created.

    The default value of this parameter removes the 'group' and 'other' write bits from the UNIX mode, allowing only the user who owns the directory to modify it.

    Following this Samba will bit-wise 'OR' the UNIX mode created from this parameter with the value of the force directory mode parameter. This parameter is set to 000 by default (i.e. no extra mode bits are added).

    Default: directory mask = 0755

    Example: directory mask = 0775 

Last edited by swatquest (2017-08-04 02:30:47)

Offline

#3 2017-08-04 10:09:48

neutronst4r
Member
Registered: 2016-02-25
Posts: 31

Re: Samba guest (read only) requires write permission on file system

I just tried it and it does nothing and it shouldn't because it is only relevant for newly created files and directories. Also, the defaults already include read access.


makepkg not war

Offline

#4 2017-08-04 14:41:32

bachtiar
Member
Registered: 2005-02-08
Posts: 65

Re: Samba guest (read only) requires write permission on file system

As it seems, you are using "nobody" to access filesystem, and "nobody" only has "r--" permissions. Try adding the "x", i.e. chmod o+x /RR.

Offline

#5 2017-08-05 20:21:40

neutronst4r
Member
Registered: 2016-02-25
Posts: 31

Re: Samba guest (read only) requires write permission on file system

bachtiar wrote:

As it seems, you are using "nobody" to access filesystem, and "nobody" only has "r--" permissions. Try adding the "x", i.e. chmod o+x /RR.

Nope, that did nothing. I even used it recursively, i.e. chmod -R o+x /RR.


makepkg not war

Offline

Board footer

Powered by FluxBB