Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up a CIFS mount on my CentOS 6.4 server with autofs :

File /etc/auto.mnt :

Photos -fstype=cifs,perm,rw,uid=505,forceuid,gid=505,forcegid,file_mode=0770,dir_mode=0770,credentials=/root/credentials.txt ://adsrv01/Photos

What a ls command shows :

[root@websrv01 mnt]# ls -l
total 4
drwxr-xr-x 1 root root 4096 Apr 26 12:01 Photos

What I expect from the ls command :

[root@websrv01 mnt]# ls -l
total 4
drwxrwx--- 1 photos photos 4096 Apr 26 12:01 Photos

Do you see anything wrong ? How can I set owner and chmod right ?

Edit : I forgot to say that chown and chmod commands are denied for root user on the /mnt/Photos directory. I can't get it right, and I also tried using fstab.

This is what happens with fstab :

mkdir /mnt/Photos
chmod 770 /mnt/Photos
chown photos:photos /mnt/Photos
mount /mnt/Photos

The permissions are automatically changed and set to 755 when the directory is mounted. I can't set the mode back to 770 : permission denied.

share|improve this question

I found the answer : you have to use the option nounix together with file_mode and dir_mode

Here is my fstab :

//adsrv01/Photos      /mnt/Photos           cifs    credentials=/root/credentials.txt,file_mode=0770,dir_mode=0770,nounix,uid=505,gid=505 0 0
share|improve this answer
fstab is not autofs... – RandomInsano Jun 16 at 18:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.