2

I have dual boot Ubuntu 16.04 recently installed with a username brij created at the time of installation.And I have made a new user work and I have added it to all the groups same as brij i.e.

brij adm cdrom sudo dip plugdev lpadmin sambashare work

I have 3 NTFS partitions.Now if I run command ls -l in /media directory I am getting a output as

total 8
drwxr-x---+ 2 root root 4096 Oct 12 21:55 brij
drwxr-x---+ 5 root root 4096 Oct 12 22:18 work

So from this output, I can easily conclude that this file is owned by group root and user root. And it has also chmod as 750.

But the thing is I can acess this directory and (but I can access brij directory by brij user and work directory by work user). If the user brij don't belongs to the group root, then how can this directory is accessible. Another thing If brij and work belongs to same groups then why work can't access /media/brij directory and brij can't access /media/work directory while they can access their respective directories of their names? Am I missing something?

The output of getfactl is

# file: brij
# owner: root
# group: root
  user::rwx
  user:brij:r-x
  group::---
  mask::r-x
  other::---

# file: work
# owner: root
# group: root
  user::rwx
  user:work:r-x
  group::---
  mask::r-x
  other::---
  • That + in the ls output indicates ACLs are applied to those directories. Check the output of getfacl on those directories. – muru Oct 12 '16 at 17:26
  • I think you mean to say getfacl? right @muru – Brij Raj Kishore Oct 12 '16 at 17:29
  • I don't get it. There are 2 groups ? and what is mask here? – Brij Raj Kishore Oct 12 '16 at 17:38
1

As said by Muru, the + in the ls output indicates ACL's (access control lists). When active these superseed the normal file permissions, this can be anoying so a lot of people don't use acl's because of that.

If I'm not mistaken, you seem unaware that you where using ACL's and probably don't need it besides the normal file permission. If that is correct you can delete the ACL permission using the following command:

setfacl --remove-all -R <file or directory name>

This command removes the ACL permissions from anything in the given path. The files/directories will then fall back to using the basic file permission as you probably intended.

p.s. About you question regarding masks. When a user creates a file or directory, its created with a default set of permissions. With umask you can say what these defaults should be. You can ignore this until its hinders you, since you are now aware that you can change it when needed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.