Question About Shared Samba Directory File Permissions..

Home » CentOS » Question About Shared Samba Directory File Permissions..
CentOS 4 Comments

im trying to set up a shared samba directory for users to use on CentOS
7, but whenever I create a file from the samba client to the samba server, the owner of the file ends up being the user the share is mounted up as.. on the server (server1),

[samba]
comment = samba share
path = /samba/
read only = No
valid users = @samba
write list = @samba
force group = +samba
create mask = 0770
browseable = yes

[root@server1 ~]# grep samba /etc/group samba:x:6666:user2,user3
[root@server1 ~]# id user2
uid 10(user2) gid 10(user2) groups 10(user2),6666(samba)

on the client (server2),

[root@server2 ~]# grep samba /etc/group samba:x:6666:user2,user3

[user2@server2 samba]$ pwd
/mnt/samba
[user2@server2 samba]$ df -h ./
Filesystem Size Used Avail Use% Mounted on
//rhce1/samba 11G 4.5G 5.8G 44% /mnt/samba
[user2@server2 samba]$ touch file
[user2@server2 samba]$ ls -al file
-rw-rw—-. 1 *user3* samba 0 May 22 15:52 file
[user2@server2 samba]$ id uid 10(user2) gid 10(user2) groups 10(user2),6666(samba)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[user2@server2 samba]$

any ideas?

regards, Jason

4 thoughts on - Question About Shared Samba Directory File Permissions..

  • That’s how SMB works. Connections are user-oriented. Everything done over a given connection is done as the user who authenticated the connection.

    You probably want NFS if you want to trust the client workstations to identify separate users.

  • Gordon Messmer wrote:
    Do the users have a Linux login? If so, you can add all of them to a group, and give the group explicit access.

    mark

  • this

    force user = nobody
    force group = nobody valid users = @support
    read only = No
    create mask = 0660
    directory mask = 0770

    works here without any problems.

  • so you were able to see files created on that share with usernames other than the one that was used to mount the share?

    I tried this config and it didnt seem to make a difference.

    regards,

    jason

LEAVE A COMMENT