0

How to make directory readable by TWO users in Linux?

Should I create GROUP and add these users to this GROUP and make this GROUP being an owner of a directory?

Should this GROUP be supplementary or primary for user?

Dims
  • 13,414

2 Answers2

2

The simplest configuration would be to have one user as the directory owner and add the second user to the first's primary group.

However, this would give the second user access to all the first's files, except where group access has been explicitly excluded, which may put an undue necessity of diligence on the first user.

So it would be safer to put both users in an independent group: the directory could be created by either user or by root, before being reassigned to the shared group; or the shared group could be primary of an administrative user which is used to create the directory.

Since a primary group is unique to a user, the shared group must obviously be supplementary to at least of the users.

The discussion at Can a Linux user belong to more than one group? should give you some insights.

AFH
  • 17,958
0

Yes, to let more users have access to your directory, you should create a group, make this group owner of that directory, give the desired (read) permission for that group on the directory and add the desired users to this group, as their supplementary group.

diegov
  • 101