We have just successfully created the new user using Gamal's Our Command, the cold add user.
And this comment is much more convenient for use as a user add comment because it has interactive a
bronze.
And you are able to set the working directory, password and other settings just in one command.
Great.
No, let me demonstrate to how to change ownership for specific file or directory.
And let me create new file in home directory for this Bogdana user.
But under route user account.
Let's go back to a rude session exit.
And here now I am locked in as a road user.
And no, let's greet you.
File into home slash Mogadon.
Let's use a touch command touch slash home slash Mogadon.
And here we'll be file name do.
The steam file was created.
Let's not list contents of the home Mogadon directory.
Let's add here.
This L.
A options.
And now a seat in your file.
To dig deep.
But user name and group are set.
Because I have just created this file as a road user.
Now let's change to Bogdana user.
As you dash Mogadon, let's clear terminal and let's list contents of home directory here.
Ondar Bogdan user and no, I still see here.
This is the text file that we have just created as s road user and endorse Combes.
You'll see this information route Android.
Now let's try to modify this file to put the 60 under Bogdana account.
Let's use Nantel editor and type two Deakes D.
S argument.
And here you'll see that file, two dicks D unwrite.
And that is due to ownership issue.
Owner of this file is ruled.
And of course, when you have a look at those permissions, you'll see that only owner of this file
is able to write this file.
Here you see this W Özer users that are members of this group or other groups are not able to write
this file.
That's why we are not able to modify it.
And in order to solve this problem, you are able ise or change permissions or change ownership of this
file.
This file is located in the home directory for Bogdana user, and logically it's better to change ownership
of this file because again, this file is located in the home directory for Abbadon User.
Let's do that.
For that, you need to use comment, John.
This one.
Let's first have a look at health options for this comment.
Let's scroll a bit up to the beginning of this output and you'll see that this comment is used for change
of the owner and or group for specific file or files.
And you'll see that the throws to you need to specify options, if any.
Afterwords, you'll need to specify you own or optionally and a new group optionally.
And afterwards comes file or files list right at the next.
Let's clear terminal and type shown.
Next comes user name.
We want to change ownership of the file too.
It will be Bogdan.
And next comes file name to the text.
Let's try to enter discussions here under backdowns account.
Enter.
And of course I see here arrow operation not permitted.
Good guess.
What is the reason for this error?
Why?
I am not able to change ownership of this file.
Backdowns account.
Your right answer is very simple.
We are not able to modify this file under any of other accounts except only protocol.
That's why I need to perform this action under Rouda code and afterwards go back to Baghdad's account,
and then I will be able to modify this file as owner of this file.
All right.
Let's go back to old account exit and less five percent comment.
Joan Mogadon.
But now I need to enter a full path to this, to the Deakes defile, because now I'm the home directory
for road user.
So I am type in here, slash home, slash mogadon, slash to the extreme.
And Nola's very fire wells are ownership.
What's changed?
Unless this L.A. home Mogadon.
And yes, I see that no owner of this file to the Deakes D is Mogadon, but group remained unchanged.
The still ruled.
And that's probably not what you have expected.
If you want to change your group as well.
You need to slightly modify this command.
Let's go back to this command, John Bogdan.
And here after Colin, you'll need to specify group name.
It will be Bogdan, last press, Panter.
And no, let's verify whether something was changed here or not.
And yes, now I see user and group equal to Bogdan, my username.
Let's not go back to Bo Daniels R.
S you dash Mogadon and let's have a look at the contents of home directory.
And now I see correct ownership of this file to the text.
And of course, because now I'm owner of this file, I am able to write this file.
Modify it.
Let's try to modify it.
Nannerl to the extreme modified file with say it changes control.
Yes.
Enter and now file was successfully changed.
Let's have a look at the contents of this file.
Got to the 60.
And yes, I see here.
Contents modified file.
This.
That's how you are able to modify ownership for a specific file.
In the same way you are able to modify ownership for a specific directory.
Let's quickly do that.
And the less great new directory here in whole folder for Bowdon user and Lizardo to the gain as road
user.
Let's go back to the account.
And here, let's create a new folder in the home of Moghadam and let's name it DMP.
And now if I list contents of a home Mogadon, I'll see this new folder here.
And the owner is old and group is route as well.
And let's create a new file on this team before either.
Let's actually ceded to this team before there are.
I'll copy this folder name like so and let's touch three to dig deep.
And for the tax deal, I'll create two new files here in Team B folder.
Here they are.
And of course, owner of those files is rude.
All right.
Let's now try to modify ownership for entire folder, Tempy folder.
Let's see, city two home directory for what yours are.
And let's enter Joan.
Next comes a bog down column, Bogdan.
And here will be a path to this team before the slash home slash Mogadon.
And here we'll be dimpy like.
So let's press.
And no, let's at least contents of the home.
Bogdan and I'll see that owner of team before there was changed to Mogadon.
But if I have a look at the contents of that DMP folder, I'll still see owner root for bolls files
three to dig deep and for the DXP.
And that means that I have just adjusted owner only of the folder directory Tempy and ownership of any
included files or subdirectories was not changed.
If you want to change alter owner of the files, you need to use additional option.
Let's have a look at the help for Joan comment.
Joan, that does help.
And scroll a bit up.
And you'll find here.
Option Das Kapital are or there's that recourse.
And with this option in place, you'll be able to modify ownership of all their files and directories.
Let's try to use this option.
Let's clear terminal and type.
John, next comes option Das Kapital.
Next, we will type by user name and the group name.
We want to change ownership, too.
And here will be a path to folder.
We want to change ownership.
Here will be home Mogadon DMP.
Like so let's press enter.
And now let's verify.
Where's our files.
Older a ship in this thing before there was changed on.
Let me copy this path and alas this L.A. and based Corbitt path.
And now I see that owner for those files through the takes.
And follow takes.
He was correctly changed to Mogadon.
And of course, if I go back to Bowdens account as you Mogadon and verify contents of a home directory
and the list files and folders in Dimpy folder, I'll see correct ownership everywhere.
And that means that now I am able to modify those files to take stock of what it takes to at least write
it weekly and.
Dean Beiste less through the D..
Here I am using a relative path without any slashers or I am actually able to use the same syntax fielder.
And here will be a slash.
It means that I am accessing specific file inside of the home directory of this user.
Lets press enter.
And here at the hello saved changes.
Yes.
Enter.
And now let's read the contents of this file.
Team B.
Three.
Steve and I see it.
Those contents here.
That's how we have successfully changed ownership for an entire directory and all in their files and
directories.
Right.
That's all for this lecture.
And now you'll understand how to change ownership for a specific file.
Files or directories.
Next, let's talk about permissions and I'll explain you how to modify permissions.
And I'll actually demonstrate to source how to create executable script links.
And we will with very basic, simple sweep that will simply print.
Hello, roll to the terminal.
I'll see you in the next lecture, guys.
Bye bye.