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::---
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:
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.