LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Samba on FC5 won't let me use group share (http://www.linuxquestions.org/questions/linux-software-2/samba-on-fc5-wont-let-me-use-group-share-506092/)

bskrakes 11-29-2006 10:38 PM

Samba on FC5 won't let me use group share
 
Hello all!

Well it has been a while but I finally have found time to spend on my Linux box again. Anyway lets get down to business right away!

I am trying to get my Samba share folder to allow a GROUP read/write but it wont' let it. I am wondering if the Samba permission are set wrong. See I have read a fair a bit about it now and I still can get it to work like the good old tutorials and other documents say it should. SO I COME HERE TO SEEK ADVICE!!!

Here is what a share looks like:

[test]
comment = test samba
path = /home/samba/test
writeable = yes
browseable = yes
valid users = brendan, kris, test


IN this particular share the USER test also has brendan and kris attached to the group (unix-group), so technically this share should work? Unless I am completely dumbfounded. I mean I can see it but I can write to it what so ever?!?!?!

Please help! Thank you.....

ScooterB 11-30-2006 09:43 AM

You must go in and set the Linux file permissions to match what you are trying to allow samba to do. They must match. So, if you have some individuals who are in group "sales" in their samba permissions, they must also exist in the same group for Linux login and for the directory/file permissions.

So you have to insure that when you have a file, say "Novembersales", when you ls -al and look at the file permissions, it must have the group sales in the group area.

Does all of that make sense? Give it a go and repost.

bskrakes 12-02-2006 10:23 PM

Ok so I have done as follows:

created a "group" called test, not a linux/unix user just a group. i then added kris and brendan to that group. i then went into the shell and tried to change owner ship of the group root to test and it gives me and error, invalid user. i am guessing that i have to have a user named test and then in the grouip add kris and brendan.

i do recall trying this many a time. please read and re-confirm that i have not done anything wrong!

thank you for your responce!

ScooterB 12-03-2006 04:09 PM

In order to change any of those kind of attributes, you must be root or have the root priviledges. When I get ready to do those kinds of things, I usually su - and then hit enter. Then it will ask you for the root password, which you enter and then hiththe enter key. You can do it like that or set the sudo users. You will have to have the root password form when the Linux OS was installed. Try that and repost.

bskrakes 12-03-2006 11:59 PM

Yes I have done this as root. However I have been doing most of the settings through the GNOME desktop interface which prompts you for the root password to change user, samba, services, etc. It should have worked.....

What should the file permissions be? Example 775? 755? obviously this affects the users ability to do things but because I am setting a group does the privileges have to be different?

I would think that making a user a member of a group would give the user the permissions of that group as long as they were the owner of that file or directory.

Cheers,
Brendan

Micro420 12-04-2006 01:40 AM

Add this to your [test]
[test]
comment = test samba
path = /home/samba/test
writeable = yes
browseable = yes
valid users = brendan, kris, test
directory mask = 0775
create mask = 0775
force group = test


Or change to whatever permission you like, such as 0777 or 0770. Problem solved, assuming your Linux file and group permissions are set up correctly. Now your users in group 'test' can read/write and share as a group via SAMBA.

It seems like what everyone else is suggesting is a Linux permission issue. I'm assuming you're taking it from a SAMBA configuration point of view. Both are easy to resolve.

bskrakes 12-05-2006 12:24 PM

By adding:
Add this to your [test]
[test]
comment = test samba
path = /home/samba/test
writeable = yes
browseable = yes
valid users = brendan, kris, test
directory mask = 0775
create mask = 0775
force group = test


Basically I am setting the permissions through Samba, correct? How ever if I were to set it through Linux by changing lets say:

drwxr-xr-x 2 root test 4096 Nov 29 21:05 test (original permission)

drwxrwxr-x 2 root test 4096 Nov 29 21:05 test (new permissions)

When I set the permissions this way anyone can write to the file/directory who is given access. The problem is that I should just be able to give access to the "group" and the members of the group should have the permissions of the group. By adding what you have suggested it should work. I had read that adding those few fields would help just didn't want to try it yet as I was trying to understand the difference between setting the Linux/UNIX permissions verse SAMBA.

I will try your suggestion and see what happens.

Thank you!

ScooterB 12-05-2006 01:32 PM

That is good. Let's look at how this is all set up to make sure that everything is okay. Remember, Linux is your OS and Samba is an application that allows Windows users to have access to the Linux box. So, the basic file/directory permissions will have to first allow the Linux users to that file (and do with it as the permissions allow). This would be tested by logging into the machine as the Linux user and see if you can in fact do with as you seem fit. The next step is to make sure that the Windows users can do what they need to. The first part of this is through Samba. Set up the smb.conf file to give them that permission(s). Then, when Samba hands it off to Linux for authentication and permissions, Linux will check to make sure that they once again have permissions to do what they are trying. As far as the Linux file structure, when you do the "ls -al" on the directory and you see the "drwxrwxr-x" (or whatever), the first three indicate what the files owner can do. r=read, w=write, x=execute. The next three letters indicate what the group can do. The next three indicate what a guest could do (or third party app). The "d" indicate a directrory. So, if you have the group "sales" and they need to access a particular file and the file is owned by John Smith, you should see something like this: drwxrwxr-w johnsmith sales (file size and last modified date follows). If that is all cool and Samba is set up correctly with the proper access/permissions, you should be off and running. Take alook at all of that and repost!

jahjr 12-06-2006 09:24 AM

for what it is worth:
In a terminal window, go to the folder containing the folder you want to open to the test group. enter ls -l. The owner should probably be root. The group should be test. If not, enter chgrp test [name of folder]. Hope it helps but no guarantees

Joe

bskrakes 12-09-2006 12:10 PM

Success, I think.

Well I have my samba shares working. Here is how they are set up:

user(s) in Linux:
brendan
kris

group(s) in Linux:

samba (members: brendan)
media (members: brendan, kris)

shares:
/home/samba
drwxrwxr-x 3 root samba 4096 Dec 6 22:32 samba
/home/samba/media
drwxrwxr-x 2 root media 4096 Dec 6 22:32 media


I had to change the permissions on the directory/files which are being shared in order for the groups to be allowed read/write. I originally thought that but I thought SAMBA would configure those settings automatically.

Cheers and thank you for all your help!
Merry Xmas!
Brendan


All times are GMT -5. The time now is 11:29 AM.