LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2011, 12:10 PM   #1
carnyx88
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
Samba configuration


Hi Guys,

Im a student at a high school in the netherlands and i have a question about a Samba configuration. I must say that i'm verry noobish in the linux world.

Problem:
I have set up my domain with samba on a ubuntu 9.10 server. I have two clients with win xp and win 7.

Now i have made a directory named /var/data, and in that directory are 3 sub directories. /var/data/netlogon (this one i use for my login script), /var/data/public (this one is for my applications i want to distribute and last but not least /var/data/profiles. With my smb.conf file i list that the profiles are being stored in /var/data/profiles.

As you would know i'll have to set that rights on /var/data/profiles to 777 (regardless wich type of user i have) before it can wright to that directory with my first logon in windows. After that i must set that back to the initial rights.

And you can imagine now that this is way to much work when I want to add a 100 users during a week or two.

So the solution will be one where the rights of the /var/data/profiles directory are safe (755 or something) but when i logon with a new user for the first time it should be able to wright the profile without me having to change the rights first.

Any idea's? any solutions? please respond to my thread.

Thanks in advance,

Mats

P.S. if additional information is needed please say so.
 
Old 06-17-2011, 01:17 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

Quote:
... be able to wright ...
you mean 'write', right.

I can say only that you set the permissions to 777 is ok.
Then when you want all the users to be able to write to the shared dir use a configuration like:
Code:
# This one is useful for people to share files
[profiles]comment = Profiles
   path = /var/data/profiles
   read only = no
   browseable = yes
   writable = yes
   guest ok = yes
   public = yes
to all directories you want to share (in your case all subdirectories set to 777 - /var/data/public , /var/data/profiles )
then all the files will be owned by 'nobody' and shared to all users,

otherwise you may take a look to example from "smb.conf"
Code:
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765
From my point of this setup in my company we have also some XP, Vista, Win 7 computers shared 2 folders on 'server' and this is working to all users can read/write the files.

good luck

Last edited by lithos; 06-17-2011 at 01:20 PM.
 
Old 06-17-2011, 02:02 PM   #3
carnyx88
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Lithos,

Thank you for replying.

Off course I meant write.... I must have thought about Orvill =P.

But let me get this straight. I will put my users in a group called "samba users", I will link that group in my smb.conf to the /profiles directory. Then I manually give the directory the "chmod 0764" command. The sticky bit will make sure that the users in the group can not delete my /profiles directory and all the files in it. But they are able to write in the directory and on the files? Am I right? So the only one who can delete the folder is my own account (owner) and the superuser? Because that is exactly what I want. But now in your example I do not get if I still need the create mask option in smb.conf or is that just an additional/template kinda option?

With kind regards,

Mats
 
Old 06-18-2011, 04:27 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
they are able to write in the directory and on the files
yes

Code:
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765
this is just an example, no need to use 'create mask' (if you want you can define that files which will be uploaded will have specific rights - like 764)

Last edited by lithos; 06-18-2011 at 04:29 AM.
 
  


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 configuration hiranyan Linux - Newbie 3 04-09-2010 01:26 AM
Samba Configuration BlandoCal Linux - Networking 10 10-29-2008 03:31 PM
SAMBA configuration nawin_g Linux - Networking 9 11-08-2005 03:23 PM
Samba Configuration ..? matrixpk Linux - Networking 13 05-31-2005 09:55 AM
Samba Configuration EzehM Linux - Networking 6 06-24-2004 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 AM.

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