We have a CIFS share on our network. I have a centos 6.3 server in which I want to map the share. The problem is that when mounting it in /etc/fstab I have to set which user (and password) to use. The problem is that the linux server has many users. I would like the local user to be used when interacting with the share (so the permissions for the share are the same as the user's instead of one for all). Furthermore, I do not want to save the password in plaintext (even the credentials file is plain text even if the permissions are limiting). Is there a solution for this?


look at autofs which dynamically mounts shares using the automount daemon. look at the man pages and you should come up with something similar:

/cifs /etc/auto.home --timeout=10 

share -fstype=cifs,rw,credentials=/etc/samba/credentials ://

Think the problem you have there is that if you edit fstab the share will only be mounted once, as it is only mounted once it can have only one uid. Have you thought about using group privs for the mount?

the only alternative would be to remove the entry from fstab and instead have the login profile mount the share for each user as they login ( and unmount when they exit ) although this is a messy alternative.

Probably best to mount once using generic user account and provide group privileges to those users allowed to access the files.


I think you can use fusesmb or gvfs-mount.


As the sysadmin you'll need to add the user to the local fuse group. The following steps are executed by the user.

  • If logging in from a remote shell (SSH), execute dbus-launch bash. (If logging in to Gnome locally, this should be done for you.)
  • The user can mount the share either in Nautilus (Places -> Connect to Server...), or from the command-line with gvfs-mount "smb://domain;username@host/share". They may need to start the gvfs-fuse-daemon if it's not started automatically. I haven't solved this problem in my own environment, yet. (/usr/libexec/gvfs-fuse-daemon ~/.gvfs) Shares will be mounted under ~/.gvfs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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