Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Rep:
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?!?!?!
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344
Rep:
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.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Original Poster
Rep:
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!
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344
Rep:
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.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Original Poster
Rep:
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.
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
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.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Original Poster
Rep:
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.
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344
Rep:
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!
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
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Original Poster
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.