I have an ubuntu 10.04 server that I want to share files to windows and ubuntu users. I also want them to use the login/password provided by my ldap server.

Now, I am not sure about which path to go now (yay unix, so many ways of doing the same thing :D).

I want the users to have a private folder (Accessed only by the user), one group folder (full access to the entire group) and a general folder (for everyone on the network).

Now, back on my windows server days I used to have one big shared folder with permissions like this

---shared folder (all can see but not write to it)
------group1 folder (all can see but only group can get in, but not write on its root)
---------user1 folder (group can see, but not get in, only user with full access)
---------user2 folder
---------user3 folder
---------group1 group folder (group can see and write to it with full access)
---general folder (everyone can see and have full access to it)

repeat the same group1 folder structure for other groups.

Now, this was easily done in windows managing the users permitions. I am not sure how to replicate this functionality on ubuntu, for both my ubuntu and windows users.

Is that structure doable? Or should I simply go and make separate shares for everything? (one share per user, one per group, one general) Or am I missing some other way to do that?

I am not asking for a detailed how to for all this, but an idea on how to do it and which tools I should be looking at would be greatly appreciated. I dont mind having a GUI (web or not) or just using plain good terminal.

I intended to do this using samba+ldap (ldap server is already working just fine on another VM).

So any ideas?


You can do it. Just follow these permissions and ownerships:

Inside of the folder share, you may have this folders:

drwxrwxrwx  2 root root 4096 2011-11-23 18:20 general
drwxr-xr-x  5 root group1 4096 2011-11-23 18:20 group1

Inside of group1:

drwx------ 2 user1 group1 4096 2011-11-23 18:20 user1
drwx------ 2 user2 group1 4096 2011-11-23 18:20 user2
drwx------ 2 user3 group1 4096 2011-11-23 18:20 user3
drwxrws--- 2 root group1 4096 2011-11-23 18:20 group1

You have to set the UMASK to 002 and pay attention to the sticky bit (chmod g+s) given to the group folder.

user1, user2 and user3 must be member of group1.

Let me know if it worked!


  • I will try that. Is there anyway that users with group1 as a secondary group to be able to access the group folder too? Boss may want access to all folders :) – Fernando Nov 23 '11 at 20:50
  • Yes, every user with group1 as secondary group will have access to this folder. The sticky bit will take care of making all new files belong to group1. I will correct my post. – Paulo Arruda Nov 23 '11 at 22:42
  • Sorry for the late reply, the solution works, but I moved in a different way in my project so I forgot to come here and hit the button :) – Fernando Dec 7 '11 at 20:47
  • Ok, im glad to see it worked! – Paulo Arruda Dec 11 '11 at 18:55

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.