how to allow different users of same group access/edit files/directories created a user of same group
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.
Related videos on Youtube
Stanislovas Kalašnikovas
Updated on September 18, 2022Comments
-
Stanislovas Kalašnikovas over 1 year
here is my example, here I am logged in as root
- created a group using groupadd command called as devel.
- created two users dev1 and dev2 using useradd command. useradd -g devel dev1 useradd -g devel dev2
- passwd set for both users
- su dev1 ... now I create some files and directories.
- exit
- 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 over 11 yearsUsing 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 over 11 yearsI was going to get to that next if @ted came back with more follow-up 8-).