In this demonstration, we're going to go over how
to modify file and directory ownership.
Now, first
for a little review we're just going to view
the permissions
and ownership of a file that's commonly used.
Log Cron file.
We can see this is owned by the root.
The group is also root.
That's the default way of creating files.
Now let's look at another user.
Look at the contents
of a testuser's file
that created earlier.
Now we use sudo since that's not
wait (indistinct)
So now we can see that testuser owns
and it's the group of these files.
Now we're going to make a shared directory.
We're put it in the root folder,
make directory here.
Use an example over our Legal department.
We'll change to that directory.
Create a test file.
Oh!
sudo
here.
And now we see the files.
So are created.
Just remember whenever there's an issue
with permissions and you enter the sudo password
just do sudo exclamation point, exclamation point
and it's going to execute the last command.
All right.
So we see we created a legal directory
and we added three files to it.
Now you see we use the sudo command
in creative file, the owner's going to be the root
and the group is also going to be the root.
next we're going to change the owner
of the hard directory
and do sudo change mod,
All right! here change the permissions.
So the dash R means recursively.
So that means we're going to do all the contents
of this particular directory
do
here
And now if we list this up we'll see
that the permissions have changed.
The asterisk mean the current director that you are in,
it will recursively execute that command on every file
or directory in the current present working directory.
We're going to add a group here
include as a lead group
with Legal department.
we're going to associate the legals department ownership
to this folder.
There's two ways to do
this You can do the sudo change own cursor,
Recursive we want to do an entire directory.
Now when you put the colon first,
that just means
that we're only going to change the ownership of the group.
Now, if you have a username before the colon
that's going to change the ownership.
That's what we're going to give the permissions
of the Legal department.
And since I'm currently
in this folder we're just going to do
to list ld option.
which lets you view the permissions
of the current folder that you're in
and we see that we changed the group own
to the Legal department when prior it was root
and we do the same thing here.
We change the owner through testuser
and here we want to do recursively
since it is a directory.
Change it to Legal department.
Do it again.
Now we see the testuser now owns the permissions
of this directory,
meaning that the testuser can modify any privileges
to the files and the contents of that directory.
Now there's another command we can use
to change the group simply changed group.
Since we're the root folder we're have
to add a sudo command.
So we're going to change the group here
to the Graphics department
Legal.
If we list this up,
we will see that the group has changed
to the graphics department.
Finish out this demonstration.
We're going to change one
of the files ownership to testuser.
So we'll see, test one, it's all owned by testuser already.
So I totally changed someone else.
Change it back to me.
So we'll change over changed sudo.
Since I'm not the current owner going change the ownership
to jkelly
Test first
file.
let's see example
and see that the ownership has changed
in that reps of this demonstration.
We went over how to change the ownership
of files and directories.
And I'll see you in the next.