Find the answer to your Linux question:
Results 1 to 10 of 10
I've got a redhat system running as a file server using SAMBA. Everything pretty much works, except for a really irritating problem with the shared area. I've got two users ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2003
    Location
    Bucks, UK
    Posts
    40

    Problems with samba, groups and permissions


    I've got a redhat system running as a file server using SAMBA. Everything pretty much works, except for a really irritating problem with the shared area. I've got two users , say Mary and Joe, who are members of the same group, mycompany. They are also members of their own groups. If there is a file in the shared area, with read/write permission for owner and group (read only for other), then both Mary and Joe can read and write the file. The problem is that if Mary writes the file then the file group becomes Mary and the group permissions are set to read only. This means that Joe can't write the file any more. The problem is symmetrical. I've thought of a few workarounds, but they all have drawbacks.

    1. Eliminate the groups Mary and Joe, or at least make the primary group of users Mary and Joe mycompany. This might fix the group, but not the lack of group write permission.

    2. Make the share accessible to anyone. Undesirable.

    3. Try and write a logout script which resets the permissions and group ownership of all files in the shared area.

    4. Give up on SAMBA and use NFS. Are there any free NFS clients for Windows 2000?

    Any ideas?

  2. #2
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    To fix write permissions just set passwords for your smb users.

  3. #3
    Just Joined!
    Join Date
    Apr 2003
    Location
    Bucks, UK
    Posts
    40
    I don't see that it's a password problem, as the users are authenticated and there's no guest or anonymous users allowed. The users can write files without problems, the difficulty is that the files are rewritten with the "wrong" group and "wrong" permissions.

    I've now realised that I should probably have posted this up in the servers section

  4. #4
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Can you do a ls -la and post he results of the folder in question?
    The fact that Mary and Joe have their on group is not a factor do not delete those groups. The folder should not change groups depending on who writes to it. Also post me the results of your group file
    /etc
    less group

    Mike

    something to check. in you /etc/group file scroll down to the group you created. There should be a group called "mycompany" or whatever the reall name of the group you created then there should be a colon
    then you should have typed mary and joe so it should look like this
    example
    mycompany:105:mary,joe

    Check that
    then go to you mycompany folder where ever it resides and type this for permissions
    chgrp -R mycompany mycompany # or what ever the name of the file is #file is second group if first
    then change permissios
    chmod -R 775 mycompany #or whatever you filename is.
    -R is recursive.
    the last command is making root and group full read write execute permisson and everybody else read and execute. if you don't want anybody else to have any access other than joe or mary type this
    chmod -R 770 mycompany

    Mike
    chmod 775 mycompany
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  5. #5
    Just Joined!
    Join Date
    Apr 2003
    Location
    Bucks, UK
    Posts
    40
    Mike,
    Im using the chmod -R and chgrp -R to put things back. When things are the way I expect, ls -la reads like this:

    -rw-rwxr-x 1 Mary mycompany 13824 Jan 21 20:06 HUNT.DOC

    If Joe opens and modifies the file, he can write it because he is a member of the mycompany group. ls -la now reads like this:

    -rwxrw-r-- 1 Joe Joe 12800 Feb 15 21:05 HUNT.DOC

    Mary can't now modify the file because she's not in the Joe group

    The group file has entries:
    mycompany:602:Mary,Joe
    Mary:500
    Joe:501

  6. #6
    Just Joined!
    Join Date
    Apr 2003
    Location
    Bucks, UK
    Posts
    40
    BTTT

    No ideas?

  7. #7
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    "force" samba


    force owner = <owner>
    create mask = 0744
    force create mode = 0744

    # OR

    force group = <group>

  8. #8
    Just Joined!
    Join Date
    Apr 2003
    Location
    Bucks, UK
    Posts
    40
    Adam,
    that sounds like it's exactly what I need, many thanks. Can you point me at any documentation on it, as I'd like to read more before experimenting. My server's down and one of the workstations is playing up so it will be a couple of days before I get to try it out.

  9. #9
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    you may try http://us2.samba.org/samba/ and visit the "learn samba" section.

    to be honest with you, i "solved" your problem by browsing the usenet posting thru http://groups.google.com ....

  10. #10
    Just Joined!
    Join Date
    Apr 2009
    Posts
    1
    you can use:

    chmod g+s parent_dir

    then, all file that create in parent_dir will inherit group owner from parent_dir

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •