how to allow different users of same group access/edit files/directories created a user of same group

7,458

I would go over some of the basics of unix file permissions to get started. Here are some links to get you started.

A Unix/Linux Permissions Refresher UNIX permissions made easy Unix - File Permission / Access Modes Unix/Linux Permissions - a tutorial

In general you don't want 2 users accessing files in each other's home directories (/home/). It's best to make a directory somewhere else with the permissions that are shared by both. For starters you could create a directory for them under /usr/local, /var/tmp, or even make your own top level directory such as /projects, and put a directory in one of those locations that they're able to access.

EDIT #1

Per feedback from @peterph here's a good primer on how to make use of unix ACLs (Access Control Lists) in addition to the traditional chmod permissions (rwxrwxr-x) type.

Share:
7,458

Related videos on Youtube

Stanislovas Kalašnikovas
Author by

Stanislovas Kalašnikovas

Updated on September 18, 2022

Comments

  • Stanislovas Kalašnikovas
    Stanislovas Kalašnikovas over 1 year

    here is my example, here I am logged in as root

    1. created a group using groupadd command called as devel.
    2. created two users dev1 and dev2 using useradd command. useradd -g devel dev1 useradd -g devel dev2
    3. passwd set for both users
    4. su dev1 ... now I create some files and directories.
    5. exit
    6. su dev2 .... ls /home/dev1 response is ... Permission Denied

    I am new to all these things, request somebody to help to find ways in order to access files and directories. Also please let me know, how to edit files for which explicitly the chmod 774 kind of permissions are provided, since in present scenario i just get "permission denied" error.

  • peterph
    peterph over 11 years
    Using extended ACLs (offered by some filesystems) may help too, since it can specify default access permissions and thuc can make the use umask unnecessary.
  • slm
    slm over 11 years
    I was going to get to that next if @ted came back with more follow-up 8-).