In this video, we'll talk about file ownership, so determine which permissions the user has
Linux uses file ownership.
Every file has a user owner, a group owner, and the others entity, which is also granted
permissions.
This is what we refer to as UGO, UGO for user group and others.
Linux permissions are not additive.
That means that if you are the owner, permissions are applied and that's all, and Linux looks
no further.
If you are not the owner, then Linux is checking, are you a member of the group that is owner,
and if that's also not true, then you get the permissions that are assigned to others.
To find out your current permissions, you can use ls-l.
That will display ownership and associated permissions.
And if you are going to manage permissions, best practice is to set ownership before modifying
the permissions.
Let me show you what this ownership looks like.
So let me just go to any directory, user admin, why not, and use ls-l.
Well, as you can see, ls-l, it's not very interesting here.
All files have the same user owner and the same group owner, but that doesn't matter.
So what do we see?
We see this file, a random file, is owned by user root, and it's group owned by the
group root.
And then we have the permissions, and the permissions are set to read, write, and execute
in three different sets.
First set is for the permissions that apply to the user, second set is the permissions
that apply to the group, and the third set is the permissions that apply to others.
And that's how ownership affects what you can do with files.