Question

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?

Was it helpful?

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

OTHER TIPS

There is two ways.

1) install cifs-utils (if it's not already done) and try:

# mount.cifs //your.server.name/path /mnt/yourfolder -o username=your_name,password=you_password,uid=YOURDOMAIN\\your_name

"uid" is immportant. This way works in my network.

2) Set your domain as default domain during logging and setup pam_mount.conf.xml simply like that:

<volume user="*" fstype="cifs" server="192.168.1.5" path="%(DOMAIN_USER)" mountpoint="~/folder_name">

My question is how to setup chmod for ~/folder_name in mountpoint?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top