[Samba] cifs mount creates files with root:root permissions

TAKAHASHI Motonobu monyo at monyo.com
Sat Oct 15 06:55:53 MDT 2011


From: steve <steve at steve-ss.com>
Date: Wed, 12 Oct 2011 09:42:21 +0200

> I mount this share on a client:
> 
> [users]
>         comment = home folders
>         inherit acls = Yes
> 	inherit permissions = Yes
>         path = /home
>         read only = No
> 
> using this as root on the client:
> 
> mount -t cifs //192.168.1.2/users /home -o rw,nosetuid
> 
> I then login as a user on the client authenticated via ldap. No problem. It 
> takes me to the mounted folder and I can see my files. When I create a file it 
> creates it as owner root:root. Not what I want!
> 
> How can I create files on the mount as user:group no matter who logs in?
> Thanks. Steve.

Essentially it's impossible. Imaging Windows Server, you can only
create files on the Windows' share as the connected user. See:

http://lists.samba.org/archive/samba/2011-April/162234.html
https://lists.samba.org/archive/samba/2011-September/163986.html

If setuids option is enabled, you can set permissions as usual but
remember that those settings are held in *memory*, so once if you
umount and mount again, those settings are lost.

---
TAKAHASHI Motonobu <monyo at samba.gr.jp>


More information about the samba mailing list