Forcing Samba mount to use specific user and file modes

Solution Unverified - Updated -

Issue

  • A CIFS share mounted from Windows will have all files assigned a specific user and file mode because the server does not support Unix extensions. However, a share mounted from Samba and Linux will try to use the server side permissions, how can it be forced to mount with specifics like Windows?
  • For example, Windows backed share:
[root@client ~]# ls -al /mnt/windows-server
total 9001
drwxrwxrwx 1 root root    28002 May 15 11:11 ./
drwxr-xr-x 6 root root     4006 Jan 25 12:30 ../
-rw-rw-rw- 0 root root 13900005 Apr 15 13:30 file
-rw-rw-rw- 0 root root    30006 Apr  7 14:11 file2
-rw-rw-rw- 0 root root  8520006 Feb 25 14:39 file3
-rw-rw-rw- 0 root root   100004 May 15 11:11 file4
-rw-rw-rw- 0 root root 12000075 Apr  1 13:11 file5
-rw-rw-rw- 0 root root      203 Mar 13 15:46 .file6
-rw-rw-rw- 0 root root     8003 May 10  2011 file7
-rw-rw-rw- 0 root root  9000818 Feb 19  2013 file8
-rw-rw-rw- 0 root root  8100006 May 10  2011 filea
drwxrwxrwx 0 root root        0 Sep 16  2011 dir1/
  • Linux/Samba backed share:
[root@client ~]# ls -al /mnt/linux-server
total 9999
drwxrwxr-x  3 somuser   somuser        0 May 15 11:02 ./
drwxr-xr-x  6 root      root        4096 May  7 09:28 ../
-rw-rw----  1 121600066 somuser 13890804 May 14 11:10 afiler
-rw-r-----  1 somuser   somuser       12 May 14 11:10 afile.o
drwxrwx--- 10 somuser   somuser        0 May 14 10:55 bdir/
-rw-r-----  1 somuser   somuser       12 May 14 11:03 boat
-rw-rw----  1 somuser   somuser   860005 May 14 13:23 taiyaki
-rw-r-----  1 somuser   somuser       11 May 14 13:23 pineapple
-rw-rw----  1 somuser   somuser  6900059 May 14 11:10 sukiyaki
-rw-r-----  1 somuser   somuser       12 May 14 11:10 katsuyaki
-rw-rw----  1 somuser   somuser  8200074 May 14 11:10 teriyaki
-rw-r-----  1 somuser   somuser       20 May 14 11:10 teriyaki.old
-rw-rw----  1 100040847 somuser 14480005 May 14 15:11 madeupfile
-rw-r-----  1 somuser   somuser       10 May 14 15:11 madeupfile.food
-rw-rw----  1 somuser   somuser  3100059 May 14 14:11 cookie
-rw-r-----  1 somuser   somuser       11 May 14 14:11 pie

Environment

  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content