Score:0

Giving specific rights

cn flag

I have the directory called 'sales' and 2 groups called 'Sales' and 'HRM'.

As shown below, I have a list with all directories, and connected groups. Without changing the directory's group, i need to give 'HRM' group, reading access to the sales directory.

How do I do that?

localhost:/home/SMBmelvin # ls -l
total 0
drwxrwx--- 1 root   Administratie  0 May 11 13:39 administratie
drwxrwx--- 1 root   HRM            0 May 11 13:39 hrm
drwxrwx--- 1 root   ICT            0 May 11 13:39 ict
drwxrwx--- 1 root   Intranet       0 May 11 13:39 intranet
drwxrwx--- 1 root   Klantenservice 0 May 11 13:39 klantenservice
drwxr-xr-x 1 root   root           0 May 11 13:34 Linux
drwxrwx--- 1 root   Marketing      0 May 11 13:39 marketing
drwxrwx--- 1 root   Sales          0 May 11 13:39 sales
drwxr-xr-x 1 Melvin root           0 May 11 13:34 Windows

I hope I can get a clear answer to this, thanks in advance!

Bruni avatar
cn flag
Just for clarification, you want to do this without changing the group and without giving read access to others?
Bodo avatar
pt flag
[Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551) [Edit] your question and copy&paste the `ls -l` output *as text*. Add all requested information or clarification to the question. ACLs might be a way to add permissions that don't fit the UNIX user/group/other permissions system.
Zennert avatar
cn flag
@Bruni , yes that is correct. Without changing the group, I specifically need the HRM group to have reading access to anything within that directory aswell.
Score:1
cn flag

A file can only belong to one group at a time. However, a user can be a member of multiple groups, and if a user is a member of a group that has permission to access a file, then the user can access that file as well.

The owner and group can be changed using the chown and chgrp commands.

chgrp HRM sales

would change the group of the directory sales to HRM

chmod g+r sales

would give read access to the group of directory sales.

chmod +r sales

would give read access to everybody. For more fine grained control you need to use Access Control Lists.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.