LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-21-2006, 10:58 AM   #1
Clowncar
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Rep: Reputation: 0
Samba filesharing-rights


Hello!

Im currently working with Slackware and Samba and now Im stuck with some settings.

Im using my Slackware-PC as a server and using Windows XP computers to connect to it. I got three accounts on the Slackware PC and using theese as accounts when logging on to the server.
Two of the users are in the same group, while the other one is alone in one group.

Now my problem is this:

I wanna make it possible for the two users in the same group to change / edit / delete etc a folder and the files in it. The last and lonly account should only be able to read the files in that folder.

I've been trying to fix this with commands in the smb.conf like write list, create mask, directory mask, read list etc and also changing the status on the files / folders in Slackware with the chmod command. But I cant fix it, since I always get the error message that I dont have the permissions to do it.

So, any hints or ideas would be greatly appreciated!

And yes, Im a beginner

If you need anything better explained or anything else, just ask
 
Old 09-21-2006, 02:30 PM   #2
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
What version of Samba are you using? Have you set up samba users as well as linux users using smbpasswd? You don't say whether the errors are from the windows client or linux?

In Samba 3.x I use
Quote:
inherit acls = Yes
in the various share definitions. That way I can define the permissions for the linux users and Samba will follow that for the Samba clients. Have a read of the excellent Samba documentation to find out the differences between linux permissions and Windows permissions - some can not be translated exactly so Samba has to behave in a certain way that may not be what you expect or require in Windows.
 
Old 09-22-2006, 06:14 AM   #3
Clowncar
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andrewdodsworth
What version of Samba are you using? Have you set up samba users as well as linux users using smbpasswd? You don't say whether the errors are from the windows client or linux?

In Samba 3.x I use in the various share definitions. That way I can define the permissions for the linux users and Samba will follow that for the Samba clients. Have a read of the excellent Samba documentation to find out the differences between linux permissions and Windows permissions - some can not be translated exactly so Samba has to behave in a certain way that may not be what you expect or require in Windows.
Im using Samba 2.2.8 and at the moment, I don't think there is any chance to change it. At least not at this point.
The problem is that when I try to create a new folder or file(with the XP PC) in the selected folder it just says that Im not allowed to.
I have the three accounts created on the Slackware machine and of course in Samba, they can log on to the server and all that. But its just a problem with the filecreating / reading / moving and so on. I've changed the statuses on the files with the chmod command, but I dont know if Samba reads it differently. I guess Samba and the filemodes cooperate , or am I wrong? I've put the mode 777 on the folder and the files in it, still I get the errors. Anything missing in the Samba .conf? Like directory mask, create mask etc.

Im posting the current samba configuration here:

Code:
#Global Parameters
server string = Test Server
workgroup = home
netbios name = samba
encrypt passwords = yes

[homes]
read only = home
browsable = no

[test]
path = /Test/testo
browsable = no
valid users = ac1, ac2, ac3
write list = @admingrp
read list = @ac1, ac2, ac3
admingrp is ac1 and ac2, ac3 got another group where the account is alone. The point is that admingrp should be able to add and remove / edit files and ac3(and his group) should only be able to read the files.

Hope you got some more info, just ask if you need anything else.

Last edited by Clowncar; 09-22-2006 at 06:47 AM.
 
Old 09-22-2006, 02:59 PM   #4
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Long while since I used Samba 2.x but your share stuff looks ok. Had a look at man smb.conf (for Samba 3) and the only thing it said there about read and write lists was that they don't work if security = share (in global section). Your global section is silent on this. I'd suggest putting security = user in the global section and see if that helps.

Failing that then the only reliable way to debug this stuff is to start with a basic share, get that working and then add the additional read/write stuff one at a time and see what effect it has. Sorry I can't be much more help.
 
Old 09-22-2006, 04:07 PM   #5
Clowncar
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andrewdodsworth
Long while since I used Samba 2.x but your share stuff looks ok. Had a look at man smb.conf (for Samba 3) and the only thing it said there about read and write lists was that they don't work if security = share (in global section). Your global section is silent on this. I'd suggest putting security = user in the global section and see if that helps.

Failing that then the only reliable way to debug this stuff is to start with a basic share, get that working and then add the additional read/write stuff one at a time and see what effect it has. Sorry I can't be much more help.
Any help is good help

I will try that and return with a answer.
 
Old 09-25-2006, 07:30 AM   #6
Clowncar
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Hello again!

Im trying a new approach on this problem. First of all, Im setting all the options to the folder and files through Slackware. This works perfect, Its like I want it to be, the users got limited rights etc. How do I 'transform' this to Samba and a Windows client? Any commands in samba? Most of the files on the Slackware PC got the status 774 (applied with chmod).

My current Samba conf:

Code:
#Global Parameters
server string = test
workgroup = HOME
netbios name = samba
encrypt passwords = yes
security = user

[homes}
browsable = no

[head]
path = /HEAD/
browsable = yes
valid users = ac1, ac2, ac3

[share]
path = /HEAD/share
browsable = no
valid users = ac1, ac2, ac3
Now, I do need to configure the create mask and folder parameters? Add more options in Slackware (777, 7773 etc)?

So basically, I want my Slackware configuration for theese maps to be converted to Samba and giving the same rights on a Windows XP
SP2 client logging on to the Slackware server, as on the Slackware PC.

Last edited by Clowncar; 09-25-2006 at 07:33 AM.
 
Old 09-25-2006, 05:54 PM   #7
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Although my system is Samba 3, I tried out the 'valid users' directive to see what happens. Put directory permissions on share to allow read write access for 'users' group - anyone could view/create etc. Added 'valid user' restriction and only that person could even view the share. When logged on as a different user trying to browse to the share popped up a password box which no matter what I entered I couldn't get past.

Now although this restricts access to specific users I'm not sure whether it's the best way to do it.

I don't use the valid user stuff to restrict access. What I have are separate data areas for each user (/data/user1 /data/user2 etc) and a shared area that all users can see. I use the '%u' parameter to map the relevant data area to the user dynamically ie any user will see a share called 'data' but it is in fact only his own data area:

Quote:
[data]
comment = Network data area
inherit acls = Yes
path = /data/%u
read only = No

[shared]
comment = Shared network data
path = /shared
inherit acls = Yes
read only = No
Have a look at the samba.org HOWTO or Samba by Example - there's heaps of excellent stuff there that explains how Windows browsing works and also how Windows directory/file permissions differ from *nix.
 
Old 09-27-2006, 10:16 AM   #8
Clowncar
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andrewdodsworth
Although my system is Samba 3, I tried out the 'valid users' directive to see what happens. Put directory permissions on share to allow read write access for 'users' group - anyone could view/create etc. Added 'valid user' restriction and only that person could even view the share. When logged on as a different user trying to browse to the share popped up a password box which no matter what I entered I couldn't get past.

Now although this restricts access to specific users I'm not sure whether it's the best way to do it.

I don't use the valid user stuff to restrict access. What I have are separate data areas for each user (/data/user1 /data/user2 etc) and a shared area that all users can see. I use the '%u' parameter to map the relevant data area to the user dynamically ie any user will see a share called 'data' but it is in fact only his own data area:



Have a look at the samba.org HOWTO or Samba by Example - there's heaps of excellent stuff there that explains how Windows browsing works and also how Windows directory/file permissions differ from *nix.
Hey, and thanks again for your help.

Today my Slackware crashed and I had to reinstall everything. So, Im going to use the smb-sample now and see if it makes a difference. I will return if I got more questions.

Again, thanks for your help.
 
  


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
Filesharing using Samba-Good Mandriva tutorial Micro420 Linux - Networking 0 04-22-2005 11:03 AM
Samba Access Rights esasse Linux - Newbie 6 12-22-2004 06:45 AM
Access Rights using Samba Nylix Linux - Newbie 1 05-14-2004 03:01 PM
Mandrake 9.2 Samba / Windblows 2000 Server FileSharing? DangNewbie Linux - Networking 1 04-28-2004 03:04 AM
Samba Access rights ppuddick Linux - Networking 2 07-17-2002 11:28 AM

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

All times are GMT -5. The time now is 02:26 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