Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a server running a samba instance which I access with cifs. When the system boots the folder is mounted but with wrong uid and gid. When I umuont and mount again manually, uid and gid are set correct (according to my credentials file).

Here's the relevant fstab:

//arkansas-1/data/ /home/me/dataArk cifs defaults,users,credentials=/home/me/.cred

Thanks for suggestions!

share|improve this question
up vote 2 down vote accepted

The UID and GID used for the mounted fs is different from the credentials used to connect to the cifs fileserver. So, I can connect to the fileserver as bob, but mount the filesystem as larry. So, you should use the uid and gid mount options in addition to the credentials option.


for example, if your NetID is "zorro999" and your password is "zorrospassword", and you use /etc/cifspw for the credentials filename, and your local user on your home computer is called "bigzorro", your fstab should have the following line

// /mnt/h-drive cifs uid=bigzorro,credentials=/etc/cifspw,domain=Princeton 0 0 

of, if you want to mount it with SAMBA, it should look like

// /mnt/h-drive smbfs uid=bigzorro,credentials=/etc/cifspw,workgroup=Princeton 0 0 

and in /etc/cifspw should be



share|improve this answer
Ok thanks for your suggestions but I'm still confused about the fact that a simple "umount; mount dataArk" stanza mounts the folder with the correct permissions. Does that mean that in the boot process my UID and GID are not avaiable when fstab is executed? – BandGap Aug 14 '12 at 8:28
I actually tested your suggestions and it worked so far that I can edit files. Unfortunately I cannot execute them. The worst thing though is that when I manually umount and mount again, the uid is set to root. I also added a gid=me to fstab with the effect that gid is also set to root when I ummount/mount... I don't understand why that is happening. – BandGap Aug 14 '12 at 9:18
That is absolutely correct, the 'users' option will cause mount to use the uid of the user running the command. At boot time, that is root. As for making files executable, you need to tell mount what permissions to use. The relevant option for cifs is 'file_mode'. So, adding something like 'file_mode=0754' to the options list would make all files read/write/execute for the uid in the mount command, read/execute for the gid, and read-only for all others. – Jeff Putney Aug 14 '12 at 12:32

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.