LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-05-2009, 03:40 AM   #1
StarQuake64
LQ Newbie
 
Registered: Jul 2005
Location: The Netherlands
Distribution: Ubuntu
Posts: 3

Rep: Reputation: 0
Samba folder containing subfolders with specific rights


Lately I'm getting this question a lot.
For every project I want to create a tree like this:
Code:
- project
  - drawing
  - secretariat
  - coordination
Everyone should be able to read/write in 'project'.
Only drawing should be able to read/write in 'drawing'.
Only secretariat should be able to read/write in 'secretariat'.
And so on...

I think I can manage to set this up in samba. The problem is, is there a way to enforce those rights when a new project is created from a windows client?
 
Old 06-05-2009, 04:32 AM   #2
suhas!
Member
 
Registered: Mar 2007
Posts: 100

Rep: Reputation: 17
Quote:
Originally Posted by StarQuake64 View Post
Lately I'm getting this question a lot.
For every project I want to create a tree like this:
Code:
- project
  - drawing
  - secretariat
  - coordination
Everyone should be able to read/write in 'project'.
Only drawing should be able to read/write in 'drawing'.
Only secretariat should be able to read/write in 'secretariat'.
And so on...

I think I can manage to set this up in samba. The problem is, is there a way to enforce those rights when a new project is created from a windows client?
Well, how would samba server know which group should have permissions over new project (folder) created from Windows Client machine? The new project would get read/write permission for everyone, i.e. inherited from parent folder project. Can you explain more about your query?

PS: you may want to look at swat... a gui based samba administration tool which you can use to manage samba server from client machine
 
Old 06-05-2009, 05:02 AM   #3
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
You can create in advance every folder for every project ...or ...this is what I've done...I've created a web interface on the samba server..and when someone wanted to create a new project...he would access the web interface and create the folder structure from there.The web interface allowed the users to manage projects...create/delete, add information about them.
 
Old 06-05-2009, 12:29 PM   #4
ABL
Member
 
Registered: Mar 2005
Location: NYC
Distribution: CentOS 5
Posts: 54

Rep: Reputation: 16
A script??

Isn't this a problem just crying out for a script?

You could write a script that would take an input of a name (say, $project), and create the directory structure in the appropriate location. It seems like it would be pretty straightforward:
#!/bin/bash
mkdir /home/$project
mkdir /home/$project/drawing
mkdir /home/$project/secretariat
mkdir /home/$project/coordination
chmod 777 /home/$project
chmod 770 /home/$project/drawing
chown drawing:drawing /home/$project/drawing
...

Make the script executable by whoever is allowed to set up projects, and make sure it's accessible.

Throw in some error checking, test it, and voila! Or am I missing something?
 
Old 06-05-2009, 01:05 PM   #5
StarQuake64
LQ Newbie
 
Registered: Jul 2005
Location: The Netherlands
Distribution: Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks!

Thanks! All 3 replies are pretty useful.

Now looking if there is a way to automatically trigger the script. But running it from a webpage will do for now.
 
  


Reply

Tags
samba, security, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing directory default creation mask for specific folder - NOT samba. maginotjr Linux - General 3 01-21-2009 10:36 AM
Determine if folder has subfolders with out overhead from find or ls davstin2002 Programming 8 12-21-2006 03:26 PM
Determine if folder has subfolders with out overhead from find or ls davstin2002 Programming 1 12-20-2006 06:49 PM
changeing permissions for a folder + subfolders and files ? YBA^[x] Slackware 7 08-06-2004 05:07 AM
what order for all file rights includinb subfolders? jaan kaer Linux - Newbie 4 11-23-2003 06:01 PM


All times are GMT -5. The time now is 09:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration