Samba – On startup cifs mounts with wrong uid, gid

cifssambaubuntu-12.04

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!

Best Answer

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.

from http://webscript.princeton.edu/~pug/faqwiki/index.php?title=Using_SAMBA/CIFS_to_access_Windows_Shares

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

//files.princeton.edu/zorro999 /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

//files.princeton.edu/zorro999 /mnt/h-drive smbfs uid=bigzorro,credentials=/etc/cifspw,workgroup=Princeton 0 0 

and in /etc/cifspw should be

username=zorro999
password=zorrospassword

[edit]

Related Topic