samba question

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
Let's say I have a share in samba, how do I make it so some users only have read access to it, while some users have write access to it? On my network I have this public share but don't want it to be writable, but when logged in as administrator, I'd like to make it writable.
 

Concillian

Diamond Member
May 26, 2004
3,751
8
81
You have to edit the smb.conf file and setup the options for each share.

You can see a section of my smb.conf attached at the bottom, it shows 2 different shares I have, one writable by anyone and one only writable by specific users. Note that you have to have the usernames setup on the samba machines for it to recognize the users in the write list as valid
 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
Actually I knew about seperate shares, but I'm talking the same share.

Ex: I have a share called public. Curently it is read only, and guest accessable. But I want specific users to be able to have write access to the share. I could create another share pointing to the same path, but that's rather messy, I rather keep the same share, just different permissions per user.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
As the documenation says, you can make the share read-write but use the "read list" and "write list" directives to specify who has read and write access to a share.
 

Concillian

Diamond Member
May 26, 2004
3,751
8
81
Originally posted by: RedSquirrel
Actually I knew about seperate shares, but I'm talking the same share.

Ex: I have a share called public. Curently it is read only, and guest accessable. But I want specific users to be able to have write access to the share. I could create another share pointing to the same path, but that's rather messy, I rather keep the same share, just different permissions per user.

I think you didn't even look at my examples. One of my examples demonstrates exactly what you want. I included the other to show you how it differs from my share that is writable by everyone. (write list = xxxx )

Did you even look closely at what I said?

it shows 2 different shares I have, one writable by anyone and one only writable by specific users

Isn't what you want to have one share only writable by specific users? I said nothing about mapping two shares to the same location because it doesn't even make sense. I'm not sure how two shares pointing to the same location would even possibly do anything more for you than just one.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Might be helpful to link to the documentation.

Well I looked in the smb.conf man page, which should be installed on any machine with Samba on it.

Did you even look closely at what I said?

Of course not, he never reads the docs anyone presents to him.

 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
So I'll read over 100 pages, just to find out one little thing? It's easier to just ask someone that knows already. And "use google" is not acceptable answer, I would not know to search for "write list" if I don't know that parameter.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: RedSquirrel
So I'll read over 100 pages, just to find out one little thing? It's easier to just ask someone that knows already. And "use google" is not acceptable answer, I would not know to search for "write list" if I don't know that parameter.

Yes, read the documentation so you know what you're doing. :roll:
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Originally posted by: RedSquirrel
So I'll read over 100 pages, just to find out one little thing? It's easier to just ask someone that knows already. And "use google" is not acceptable answer, I would not know to search for "write list" if I don't know that parameter.

Searching for the answer is not acceptable... That's what you are doing here, just slower as people have to respond, or do a quick search if they have the inclination.

From google, "giving users write persmissions samba share" gives you information about write lists specifically in the second entry.

Damn you google...

*falls to the ground with fist raise up to the broken Staute of Liberty*
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
So I'll read over 100 pages, just to find out one little thing? It's easier to just ask someone that knows already. And "use google" is not acceptable answer, I would not know to search for "write list" if I don't know that parameter.

So I guess everyone should stop wasting their time writing documentation and just spread the knowledge by word of mouth, because it's easier for you?
 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
Makes sense to me, that's what help/support forums are for. Obviously I should (and did) read the docs to know the basics of the program, like how to setup a normal share, etc but I see nothing wrong in asking a question on something undocumented, or something that is less obvious to find in the documentation.

I don't know about most people but usually when I ask a question about something to anyone, I'll do a few hours of research first, then if I can't find anything or figure it out, I ask to see if someone happends to know already. But I would not expect someone to actually research for me.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Obviously I should (and did) read the docs to know the basics of the program, like how to setup a normal share, etc but I see nothing wrong in asking a question on something undocumented, or something that is less obvious to find in the documentation.

It is far from undocumented and seems pretty obvious to me. Even just searching the smb.conf man page for 'write' will eventually show you that entry.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Concillian did answer you question exactly with the information you were looking for, you just asked for the information again like you didn't even read what he posted. I think that's were the problem started.
 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
Well to be honest I missed the write list part in that code that was first posted. Anyway I tried it and it's not working, and searched on google only to find other people that also have the same problem, and most forums just say "search google"... the usual dilema. So could it be this feature is broken in samba?

Also I did restart it and even tried doing a chmod -R 777 of the whole folder to ensure that the linux permissions are set right, since I'd had write issues in the past related to this. usually if I put a file on a share from the server.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Turn up the debug level in Samba and look through the logs, the read/write list code has been in there for a very long time and I would be extremely surprised if it magically broke all of a sudden.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
You are trying to access the share as administrator, is that a valid account on the box running samba? Are you using winbind to access the samba resources?

Is destroyer a windows or *nix host.
 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
Yes administrator is a linux account as well, and I also used smbpasswd to make it a samba account. It's a normal user and not an administrator, but I don't think that matters since linux should not have to know if the user has admin rights to the local (windows) machines. correct me if I'm wrong.

Destroyer is the box (running windows 2000) that I'm trying to access the share from. The administrator password is the same as the one on the linux box. When I get home I'll post the smb.conf part for that share, it may help as well.
 

Concillian

Diamond Member
May 26, 2004
3,751
8
81
Originally posted by: RedSquirrel
Well to be honest I missed the write list part in that code that was first posted. Anyway I tried it and it's not working, and searched on google only to find other people that also have the same problem, and most forums just say "search google"... the usual dilema. So could it be this feature is broken in samba?

All I can say is it works in my setup.

If you would like to see my entire smb.conf, send me a PM and I will e-mail it to you.
 

Red Squirrel

No Lifer
May 24, 2003
70,319
13,662
126
www.anyf.ca
For the force group = trustedusers part, what exactly is in the trustedusers group? And is this a linux group, or a windows group?

I think this is why it's not working because I don't have that in my config. Here's mine:

Code:
[public]
path = /data/samba/public
comment = Public read only share
write list = administrator
public = yes
guest ok = yes
create mode = 777
directory mode = 777