‫-: Hi, within this lecture, we're gonna see
‫different kinds of permission throughout the users, okay?
‫So right now I'm inside of the kali user
‫and maybe you are inside of some other user
‫and it really doesn't matter.
‫I'm gonna show you that Eric at Linux has a root user
‫and it is the most advanced.
‫It is the most authorized user inside of the Linux, okay?
‫It goes the same for all kind of Linux distributions.
‫So the root is the administrator and super administrator.
‫It can do whatever you want, okay?
‫So if you become root, you can actually delete everything.
‫You can create some new stuff.
‫You can break the operating system.
‫You can copy everything, whatever you want.
‫So if you come over here
‫you can see that root terminal emulator.
‫And when you do that, it will ask you for your password
‫which is the password that you use as you log in.
‫So if you give that,
‫it actually creates a root terminal for you.
‫So as you can see, the username is different in this case.
‫So I'm root@kali.
‫So since I'm root, I can do whatever I want.
‫So whatever I want,
‫I mean that I can actually delete every folder,
‫every file in Windows.
‫Think about Windows.
‫If you have used Windows before
‫you cannot even delete anything.
‫It just gives you errors.
‫It says that, this is a system file
‫you cannot delete that, and so on and so forth.
‫So with root, you can do anything.
‫So let me show you what I mean.
‫As you can see, I can write ls, I can delete stuff.
‫It appears that I have a better cap history file over here.
‫Let me delete that.
‫As you can see, when I write pwd,
‫I'm inside of the root folder.
‫So a root folder, it appears that it doesn't even stay
‫in home folder right now, but I can just interact with it.
‫Like I can create a folder. I can go into another folder.
‫I can do cd test. I can do cd..
‫I can execute anything that we have seen before, right?
‫Because I'm root, I can do anything.
‫I can even delete the boot loader
‫so that the operating system won't even boot again.
‫But as you can see, since it has so much authority,
‫since it has so much permission,
‫it's a little bit dangerous to use root.
‫That's why, actually,
‫kali decided to introduce a new user called kali
‫and abandon the usage of root as the default user.
‫It really doesn't matter for us
‫because we are using this as like a virtual machine.
‫We are not using this like a real server or stuff.
‫If I was using a server like Bant or Deviant
‫I would have done the same thing.
‫I wouldn't use the thing as root in services
‫in so many cases because it's dangerous.
‫I can delete something by mistake, right?
‫But it doesn't matter for us in this case.
‫So you will see throughout the course that I use root
‫most of the time, okay?
‫Because we will actually need the permissions of root,
‫the authority of root, for installing new things
‫and executing new things at the same time.
‫So you need to understand that you can become root
‫or any other user anytime you want inside of kali Linux.
‫So let me do some more examples over here
‫so that you can understand it in a better way.
‫Right now, I'm inside of the test folder and I can go back.
‫I can write pwd and I can see where I am.
‫I can go into the root of this, okay?
‫And when I write ls, I can see
‫all the files and folders
‫available inside of the root folder.
‫And by root I mean this folder,
‫the root of the file system, okay?
‫So it can be confusing to call this root,
‫but again this is the terminology used in the Linux system.
‫But if I run ls, I can see all this home folder,
‫M and T folder, round folder and stuff.
‫Let's go into the home.
‫And as you can see, when I write ls
‫I can see kali and I can go into that.
‫I can go into any user's folder
‫inside of home folder, because I am root.
‫If I was another user,
‫I couldn't have gone into the kali's folder
‫because it's kali, right?
‫So let me open another terminal using kali.
‫By the way, if you're using this as root,
‫like the custom OV8 created for this course,
‫right now you cannot do this exercise.
‫Maybe you can just watch.
‫So if I run ls and pwd over here,
‫you can see that I am inside of the root folder, okay?
‫Not the root, root folder
‫because I cannot even go to that folder in kali,
‫because the permission is denied
‫because root is the most privileged user in this case.
‫And root can come into the kali's folder,
‫but kali cannot go into the root folder, okay?
‫Root overrides all the permission in any cases.
‫So I can go to the documents inside of kali
‫and I can even create new files,
‫create new folders if I want to, with using Root. Okay?
‫And let's try that, actually.
‫Let me go back to the kali folder or the kali terminal.
‫Once I create a new folder or new file over here
‫if I write ls inside of the documents
‫as you can see there are test and test2 folders
‫Let me create a file.
‫Let's call this something like test.txt or stuff, okay?
‫Testroot.txt,
‫so that we can understand that it's created by root. Okay?
‫So let me go back to kali
‫and try to go to the kali documents folder
‫inside of the kali terminal.
‫Right now I'm inside of home, when I write this,
‫and I can go to the kali,
‫and again, I can go into the documents.
‫By the way, I haven't mentioned before,
‫let me go back and show you what I mean.
‫If I write cd.. I can go back.
‫If I write do and hit tab, it will autocomplete.
‫As you can see, if I hit tab,
‫it will say that you want documents or downloads?
‫If I write doc and hit tab, it will auto complete. Okay?
‫So you can type faster using tab in your keyboard.
‫So if I write ls I can see the testroot txt.
‫So we don't know how to open it with an editor
‫and edit it yet
‫but you will see it in the upcoming lectures.
‫But I cannot edit that file
‫because I can read it but I cannot write it.
‫Let me try to remove it.
‫As you can see it says that
‫remove write-protected regular empty file,
‫so it's write protected.
‫Only root can write it, in this case.
‫I can try to remove it because it's in my folder, right?
‫I'm kali and it's inside of the kali folder.
‫I should be able to delete it somehow,
‫but I couldn't manage it.
‫So what I can do, I can try to run rm-f or -rf,
‫depending on whether it's a document or folder.
‫It's a document right now.
‫And remember, -f stands for force,
‫so force it to be deleted in any case.
‫And I can do that because it's in my folder,
‫even though Root created it, I can delete it,
‫but I cannot even write it.
‫Okay? I cannot even edit it.
‫And we are gonna see it in the upcoming lectures.
‫But the idea over here
‫is that root can go into any files and folders.
‫It can change it. It can create new files.
‫It can delete users. It can delete folders.
‫It can do whatever you may want it to do.
‫So root is the most privileged user
‫inside of a Linux system.
‫And depending on your situation,
‫you may be using root all the time.
‫You may be using another user all the time.
‫But the idea is to know how to use root, okay?
‫You can open another root terminal if you want,
‫or you can just switch it to the root user.
‫And you can do that in the file manager as well.
‫So let's assume that I go into the pictures
‫or any other documents and stuff.
‫I'm still the kali user, right?
‫Because I logged in as kali user.
‫Right now, I can try to create new files and folders
‫but I cannot do that in the root folder, right?
‫So let me go back to root.
‫And as you can see, it says that permission denied.
‫I cannot go into that, not by terminal, not by file manager.
‫So I can right click and say open as root.
‫It will ask me for my password again,
‫the password that I'm using for logging in
‫and I can open the file system as root user.
‫So if you want to open the file system as root user,
‫This is what you do.
‫Right now, I can go into the root folder
‫and I can delete the files, delete the folders,
‫whatever I may want to do over here, okay?
‫So that's one way to leverage root as well.
‫So let's try to see some alternative ways to leverage root.
‫For example, switching from kali to root
‫or executing comments with sudo.
‫Let's try to do that
‫because you may need to learn about those things as well
‫in the upcoming lectures.
‫So what I'm going to do
‫I'm gonna close the root terminal over here
‫or just minimize it
‫and go with the kali terminal to show you something
‫like becoming root without even opening the root terminal.
‫Okay?
‫So you need to learn about that as well
‫because once you go into the industry
‫you will need all those skills.
‫So I'm gonna close this down and I'm gonna clear this thing.
‫I'm inside of the documents.
‫It doesn't even matter where am I right now
‫because I'm gonna go back to the root folder, okay?
‫I'm gonna say cd.. cd..
‫And I'm again gonna do that. And here you go.
‫Now I can see the root folder over here.
‫Let's assume that I wanna go over there.
‫Of course, I cannot do that with the kali user.
‫Let's assume that I really wanna go there.
‫I really want to create a new file or folder over here,
‫for example.
‫I cannot even do that
‫because I'm not inside of the kali folder, okay?
‫As you can see, it says permission denied.
‫So I cannot do that.
‫I cannot go into the root.
‫I cannot create any file and stuff.
‫So I need the root user.
‫Of course, I can create a root terminal,
‫but maybe there isn't an option to do that.
‫Not in kali, but maybe I'm in some kind of a Linux server,
‫like DBN server.
‫So I can write this sudo.
‫Sudo stands for super user do, okay?
‫And if I write sudo su, like switching user, sudo su,
‫it means that I'm gonna go back to the root
‫or a privileged user.
‫So if you do the sudo su and hit enter,
‫it will ask you for your password.
‫And if you give your password
‫and it won't show up in the terminal, by the way,
‫but if you write it and hit enter, it will just accept it.
‫It won't show up because of the security reasons,
‫but it will accept it.
‫And here you go. Now I am root.
‫So you can use this to exit out of the root
‫and go back to the kali if you want.
‫So you can actually switch the users using su comment
‫or sudo su comment, depending on the situation.
‫For example,
‫we are gonna see a comment called apt update, apt install
‫which is the package manager of Linux.
‫And you cannot even do that with the kali.
‫You can either go sudo su and become root
‫or you can go sudo apt install or sudo apt update
‫which means that run this comment,
‫but run this as an administrator
‫or run this as a root user, okay?
‫It will again ask you for your password
‫and you can give it and execute the command.
‫So depending on your situation,
‫you may want to run the commands with sudo in front of them
‫or you can just become root
‫and execute the comment without giving anything before it
‫in the terminal.
‫But you need to understand this thing, okay?
‫You need to be fluent in this thing.
‫Root is the most privileged user in any Linux system
‫and you can use the sudo comment
‫in order to execute things
‫with the administrator privileges.
‫And you can write sudo su to become root.
‫And you can even open a root emulator
‫and even a root file system
‫in order to browse through the files and folders.
‫So if you get like a permission error using the Linux
‫in any time, not for cyber security,
‫it means that you are not privileged
‫to do that kind of operation.
‫It means that you have to become root
‫and then execute that command later on.
‫Now, if you understand that, it's great.
‫Now, if you see me using root user throughout the course
‫make sure you open the root terminal or sudo su
‫and do the exact same steps with me.
‫That's all there is.
‫We're gonna stop here
‫and continue within the next lecture together.