LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2003, 08:40 AM   #1
thepurpleblob
LQ Newbie
 
Registered: Sep 2003
Posts: 25

Rep: Reputation: 15
Using Samba As Fileserver


Hi,

I am trying to use a Samba share as a departmental fileserver, but am having a terrible time with permissions and groups.

I want different folders to be restricted to users in particular groups. I have done this by creating Unix groups and making those directories owned by the particular groups. I then add the group to the neccessary user's secondary group lists.

This is fine.. BUT... when a user *creates* a new file, it gets their primary group which of course screws up my plan.

I assume I can't be the first person to want to do this... so how do I set this up?

Any help, pointers, how-tos etc much appreciated.

Howard
 
Old 09-02-2003, 09:02 AM   #2
scobiej
Member
 
Registered: Aug 2003
Location: London
Distribution: Redhat, SuSE, Ubuntu
Posts: 75

Rep: Reputation: 15
Use the force group option in the smb.conf file for the share to set the group used for that share. If you are taking about individual directories within a share, never tried it.
Do a man smb.conf for details of the various options.
 
Old 09-02-2003, 09:05 AM   #3
thepurpleblob
LQ Newbie
 
Registered: Sep 2003
Posts: 25

Original Poster
Rep: Reputation: 15
Yes that's the problem. I really need it to *inherit* the group of the directory that the file is created within. *force group* is not much use as I have several different groups involved..
 
Old 09-02-2003, 09:53 AM   #4
scobiej
Member
 
Registered: Aug 2003
Location: London
Distribution: Redhat, SuSE, Ubuntu
Posts: 75

Rep: Reputation: 15
Just did a bit of checking on the samba mailing lists (and the man page). Have you checked out the inherit permissions = yes option. It is off by default but the man page implies that this is exactly what you want.
Take a read and, hopefully, that will solve your problem.
 
Old 09-02-2003, 11:18 AM   #5
sidmark-2850
Member
 
Registered: Aug 2003
Posts: 133

Rep: Reputation: 15
Read this thread first!

Someone ran into a similar situation and this post should help. The only difference, if that you want to create a directory called department with root as it's owner and group. Export that directory via samba.

Now, you want to create the departmental folders under there with the following parameters.
* Root should be the owner of each folder for each department.
* The group of each directory should be set to its respective group. IE the group of the accounting folder should be the accounting group. The group of the HR folder should be HR
* The permissions of each directory should be 2770. The setgid bit is required so that new files and folders will be owned by the group.

Your directory structure should look like this:
Code:
drwxrwxr-x   4 root     root         2048 Sep  2 11:03 departments
  |-drwxrws---    2 root     accounting     1024 Sep  2 11:03 accounting
  |-drwxrws---    2 root     business     1024 Sep  2 11:03 business
  |-drwxrws---    2 root     hr           1024 Sep  2 11:03 hr
The various masks that were mentioned in the other post are required so that the files and folders are writable by both the user and group and the permissions bits cannot be modified by windows explorer.

If this is desired, you should set group quotas so that one department will not consume all the disk space.

Cheers.

---------
By the way, it would be helpful if you mention the outcome of the suggestions made. This will help both the person postin gand other people who may be reading this thread
 
Old 09-02-2003, 02:10 PM   #6
thepurpleblob
LQ Newbie
 
Registered: Sep 2003
Posts: 25

Original Poster
Rep: Reputation: 15
Ahhhh... of course....

I had forgotten about the g+s stuff. My feeble excuse is that after far too many years of Unix and Samba, I have never had to build a big filerserver with it before. Still D'oh!!

many thanks..... saved!
 
  


Reply



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
Samba fileserver/Ghost Decompression Errors johno12345 Linux - Software 9 08-08-2007 04:41 AM
Building a RAID-based SAMBA fileserver karavshin Linux - General 2 02-16-2005 10:31 AM
Fileserver - SAMBA-SWAT Erpezoa Linux - Distributions 0 12-13-2004 04:26 PM
Samba fileserver dissapearing from network listing bindsocket Linux - Software 1 10-23-2003 02:20 AM
Implementing a HA Samba fileserver on Linux with SSI mlenehan Linux - Software 2 09-03-2003 04:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration