Find the answer to your Linux question:
Results 1 to 3 of 3
Hello friends, I'm sorry asking this question, but I need to resolve it... I have a directory into the web server. I have 2 users in the office who needs ...
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    51

    [SOLVED] Basic and Stupid question?

    Hello friends,

    I'm sorry asking this question, but I need to resolve it...

    I have a directory into the web server.
    I have 2 users in the office who needs to work with the files into that directory.
    I decided to create a group called "lesson" and I included these 2 users into it editing the file /etc/group, like... lesson:1003:user1,user2.

    I have set permissions to all the files to 775, and I thought it would work ok.
    But the problem is that, when user1 or user2 edits a file into the directory, the group of the file changes to user1 or user2, so then the other user doesn't have write permissions.

    What's the problem?? Can anyone help me?

  2. #2
    Linux Newbie
    Join Date
    Jul 2004
    Posts
    143
    Hi,

    I decided to create a group called "lesson" and I included these 2 users into it editing the file /etc/group, like... lesson:1003:user1,user2.

    Here the secondary group for user1 and user2 are lesson, but primary group for user1 is user1 and for user2, user2 only.

    Whenever U create file, it gets the primary group as its group ownership.

    Here you have two options

    1) change the primary group of the users to lesson.
    usermod -g lesson user1
    usermod -g lesson user2

    or
    2) change the group ownership of the directory to lesson and set SGID for that directory.

    chgrp lesson /path/to/directory
    chmod g+s /path/to/directory

    Mummaneni.

  3. #3
    Just Joined!
    Join Date
    Jul 2006
    Posts
    51

    It was ok...

    Thanks a lot, it works perfectly...

Posting Permissions

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