Search code examples
sambapdc

pam_mont of home and shared folders


I have a samba network. Authentication is done using winbind and uses login successfully.

Home folder is mount with no problem, but users don't have access to mounted subfolders:

/home/user -> user home /home/dept -> shared files

If I login as root and "su"; I can access to /home/user/dept with no problem. I think the problem is in mount options, but I cannot find it.

My pam_mount.conf.xml is:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
 <path>/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin</path>

 <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
 <logout wait="0" hup="0" term="0" kill="0" />
 <mkmountpoint enable="1" remove="true" />
 <volume options="user=%(DOMAIN_USER),domain=DOMAIN" fstype="cifs" server="192.168.1.5" path="%(DOMAIN_USER)" mountpoint="/home/%(USER)"></volume>
 <volume options="user=%(DOMAIN_USER),domain=DOMAIN" fstype="cifs" server="192.168.1.5" path="dept" mountpoint="/home/%(USER)/dept"></volume>
</pam_mount>

Any hint/idea?


Solution

  • It is a samba problem, because when I mount a folder using sudo I loose execution permission to the folder:

     user@computer:~$ ls -l | grep shared
     drwxrwx---   2 user domain users          0 Dec 12 16:34 shared
     user@computer:~$ sudo mount -t cifs //192.168.1.5/shared /home/user/shared -o user=user,domain=DOMAIN,uid=15002,gid=15000,rw,iocharset=utf8
     Password: 
     user@computer:~$ ls -l | grep shared
     drw-rwx---+ 43 user domain users          0 Dec 22 10:34 shared
     user@computer:~$ sudo umount shared