Not every user of a single operating system should have the same level of access to files and directories
like an a professional or enterprise level operating system.
Linux has methods for securing file under three access.
These security systems allows the system administrator, the rule accuser or the file owner to protect
their files from unwanted access or tampering by granting select user permissions to read, write or
execute files for each file and directory.
We can specify the permissions status for the files owner for a particular group of users and for all
other users.
This is a necessity in a multi user interface for enterprise level operating system.
The alternative would be quite chaotic.
So in this letter, I will show you how to check for and change permissions on files and directories
for select users.
How to set default file and directory permissions.
And how to set special permissions.
Finally, you will have.
You will see how hackers understanding of permissions might help them exploit a system.
We have different types of users in Linux, as you know, in Linux, the root user is all powerful.
The root user can do basically anything on the system.
Other users on the system have more limited capabilities and permissions and almost never have the access
that the root user has.
These other users are usually collected into groups that generally share a similar function in a commercial
entity.
In these groups might be finance, engineering, sales and so on.
So in an IT environment, these groups might include developers, network administrators and database
administrators.
So the idea is to put people with similar needs into a group that is granted relevant permissions.
Then each member of the group inherits the group permissions.
So this is primarily for the ease of administering administrating permissions and security.
The root user is part of the root group by default.
So each new user on the system must be added to a group in order to inherit the permissions of that
group.
So each and every file and directory must be allocated a particular level of permissions for the different
identities using it.
The three levels of permissions are here.
I want to show you here.
Um ah uh, permissions really clear.
And uh, we have w uh, right here, right?
And we have X here x for execrable.
So read here these grants permissions only to open, and we will file, right?
Is this a lost user to weave and edit the file?
And it is, as you know, this allows users to execute the file, but not necessarily weave or edit
it.
It is just executed if not written before, uh, read or write you.
In this way, the root user can grant users a level of permission depending on what they need the files
for when a file is created.
Typically, the user who created is it is the owner of the file and the owning group is the user's current
group.
The owner of the file can grant various access privileges to it.
So let's look at how to change permissions to pass ownership to individual users and to groups.
So granting ownership to an individual user.
To move ownership of a file to a different user so that they have the ability to control permissions
so we can use Chrome.
I'm not sure you.
Home, but this means change all or.
Change owner in Linux, so, uh, corn, for example, bulb here DMP bulbs.
Wow.
Here we give the command the name of the user we are giving ownership to, uh, bob here.
And uh, this.
Coleman grants the user account for bob ownership of Bob's file.
So, uh, granting ownership to a group, so to transfer ownership of a file from one group to another.
We can use the, uh uh, see how rep I want to show you here, um?
See, scary.
So a group.
So this is the change group common hackers are often more likely to work alone than in groups.
But it's not unheard of.
Several hackers or pen testers work together on a project, and in that case, using groups is necessary.
So, for instance, you might have a group of protesters and the group of security team members working
on the same project.
The Panthers, the Panthers stairs or in this example, are the root group, meaning they have all permissions
and access.
So the route group needs access to the hacking tools, where a security flaw can only need access to
defensive tools such as intrusion intrusion detection system ideas.
So let's say the route group download and install the program named New Ideas, the route group will
need to change their ownership to the security group.
So the security group can use it at will to do so.
The road group here and will simply enter this command.
Say who to.
Ten new ideas, this is just an example, so I will not it's common.
So this month passes the security group.
Ownership of new ideas.
So now you need to know how to check whether these locations have worked, so you will do by checking
the files permissions.
So checking permissions.
You want to find out what permissions are granted to water users for a file or directory?
Use the L.
S Command.
Unless command.
Let me look at how many minutes we have, yes, that was the last month.
Uh, within the L here, this means long speech that this will lay the contents of the directory in
a long format.
So this list will contain the permissions here.
So as L Command on the file user share hash grant one of the my favorite.
Um, federal controls here in order to see what we can learn about the files.
So.
This is them.
File type here.
And this is the permission of file here, as you can see here.
This is the the number of links, so you will learn what his links link is in Linux.
So this is the um, the owner of the file.
And this is the then size of the file in Vice.
So this means when the file is created or modified and this is the name of file.
So for now, let's focus on the seemingly incomprehensible strings of letters and dashes on the left
edge of each line.
They tell us whether an item is a file or directory and what permissions, if any, are on it.
So the first character tells you the file Typekit d stands for a directory and the hash indicates a
file.
Uh, so these are the two most common file types here.
So the next section defines the permissions on the file.
There are three sets of characters and made so some combination of read, write and execute in that
order.
So the first set represents the permissions of the owner.
The second is of the group and the last news all, uh, all of the users.
So regardless of which, set of the three letters you are looking at, if you see an R at first here,
as you can see, there are same uh.
So.
That user of group users has permission to open and read that file as Tumblr is in the middle here.
No means that they can write to modify the file or directory, and the AEC's is meaning if any geeks
at the end means they can execute or run the file or directory.
If any RW or X is replaced with a dash here.
Like that, then the respective permissions hasn't been given.
Not that the users kind of permission to execute on either binaries or scripts.