Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-14-2004, 05:12 AM   #1
Registered: Aug 2004
Posts: 33

Rep: Reputation: 15
Samba - User query

I've had a search through previous threads and can't finf anything that relates to what I need to do.

I have setup a simple samba server with 'security = user'.

I have one directory in the share. I want three users to access that share:


I want them all to be able to read ALL files on the drive, write files to the drive, and modify any files that they have written to the drive. But I want each user to have read only access to the other user's files.

How can I do this?


Old 10-14-2004, 05:46 AM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Well, assuming that all 3 users are in the same group, adding this to your smb.conf, should do what you want:

create mask = 740
That would give the owner of the file full access, members of the same group would have read access, and everybody else would have no access.

Keep in mind that this only applies to files that Samba creates, if you want these rules to apply to files that are already in the directory you are sharing, you will have to set the permissions to 740 manually with "chmod".
Old 11-04-2004, 01:58 PM   #3
Registered: Aug 2004
Posts: 33

Original Poster
Rep: Reputation: 15
Is there anyway of configuring it so that any users in the same group can write to files to a particular directory, but not delete files that belong to someone else that are already in that directory


Old 11-04-2004, 10:15 PM   #4
Registered: Aug 2003
Distribution: Debian
Posts: 53

Rep: Reputation: 15
chmod the directory read, write, execute for user and group then chmod the 'set sticky' bit (see ~$ man chmod)

files inside a directory with 'sticky' set can only be deleated or edited by the file owner. The owner of the directory will also be able to delete files.

I just read about this here:

Incase you didnt already know:
To make the files readable by only the three users: you should create a group for the users who can read the share, put user1, user2, user3 into that group. Set the share directory group to the newaly created group and 'set group' on that directory. If a directory has the 'set group' bit set, any files created are automatically assigned the directorys group instead of the creaters main group.

~$ chmod g+s dir ...........this does the 'set group' bit
~$ chmod o+t dir ...........this sets 'sticky' bit

you may just want to clarify that in ~$ man chmod

excuse the bad technical language

Last edited by Wordan; 11-04-2004 at 10:42 PM.


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
Samba -- XP user can log in to shares but smbclient user always gets password errors ejoe Linux - Software 3 04-18-2005 11:55 AM
ipchains log and samba query RichardBuck Linux - Networking 0 12-22-2004 08:16 PM
add samba user (Samba 3.0.2) geodo Linux - Networking 5 12-02-2004 09:36 AM
Map WXP user to Linux user in Samba? Worstje Linux - Software 1 03-26-2004 07:50 PM
Samba: What group/user is used by Samba to access directories? DJ_Cyberdance Linux - Networking 3 10-04-2003 05:21 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:32 AM.

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