Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a computer which is shared to domain users. They can login with their domain account. It is using ubuntu 12.04 64 bit, samba version: 2:3.6.3-2ubuntu2.10

I setup pam on /etc/pam.d/common-session

session required pam_mkhomedir.so        skel=/etc/skel/ umask=0077

When users login with their domain account, their home directory will be created automatically on /home with permission.

ls -la /home
drwx------ 19 user.test     domain users 4096 Apr 28 10:20 user.test
drwx------ 19 user2.test     domain users 4096 Apr 28 10:20 user2.test

I set umask=0077 because I don't want domain user can read other user's home directory

Now we have problem with the usershare. If domain user create a shared folder in their desktop folder (/home/user.test/Desktop/test) and share it by right click on that folder choose "Sharing Options" with the checks ("Share this folder": On, "Allow others to create and delete files in this folder": On)

ls -la /home/user.test/Desktop
drwxrwxrwx  2 user.test domain users 4096 May  6 14:21 test

cat /var/lib/samba/usershares/test
#VERSION 2
path=/home/user.test/Desktop/test
comment=
usershare_acl=S-1-1-0:F
guest_ok=n
sharename=test

The share name "test" is now available to access on the network, but only user "user.test" can access it, other users can't access it but if I

chmod 770 /home/user.test
ls -la /home
drwxrwx--- 19 user.test     domain users 4096 Apr 28 10:20 user.test
drwx------ 19 user2.test     domain users 4096 Apr 28 10:20 user2.test

I am able to access the share "test" by other domain users ("user2.test") How can I bypass this without chmod user's home directory since this is insecurity? Thanks a lot!

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.