Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

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.

share|improve this answer

I think you can use fusesmb or gvfs-mount.

share|improve this answer

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.
share|improve this answer

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

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

auto.home
share -fstype=cifs,rw,credentials=/etc/samba/credentials ://192.168.0.12/share
share|improve this answer

Your Answer

 
discard

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.