02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Sudo instead of using the root user

Before we do anything else we need to meet the sudo command. We talked about the importance of not using the root user and as such from now on we won't use that user. To access the rights of that user we add the command sudo before any command we want to trigger as the root.

Video Transcript

00:00We talked about this previously about the importance of not working with the root once you've created the user that you're gonna be that
00:07It's gonna be your superpower user
00:09So we're really gonna follow through with that
00:11But before we could follow through with it
00:13What we really need to do is we want to go into that bizudo again
00:17So I'm gonna I'm just gonna make sure that my user bender has access because we've been playing we've played around with it
00:23So much that I don't think it does anymore
00:25sbin
00:29Was that it was actually user
00:32sbin
00:34vzudu
00:36We're gonna go into our vzudu scroll all the way to the bottom again. Make sure that we have your sum
00:42If we because our user right now if I not mistaken is not in any group because we're removing and adding it
00:49So I just want to make sure that I'm gonna add here right here
00:52I'm gonna click on a and I'm just gonna add our user demo and I'm gonna give my demo user all access
00:59Just like our root itself. And as we said in our in a previous video
01:07We're gonna and we want the user to need to put a password
01:11So we're not gonna use the no password because we want to confirm each time that we're done
01:16So I'm gonna type your escape and I'm gonna save the file by clicking on shifts easy
01:21All right, so I'm done. I'm saved my user
01:24My user now has act should have now access that is similar to the root access and I'm ready to exit my root
01:32And it's time for us to log in again, but this time I'm gonna log in as my user demo
01:38So I'm gonna log in as demo and now that I'm inside as the user demo. I'm gonna type in that user's password
01:46All right, so we're logged into that user and now it's time for us to start working with the different
01:54Installation processes. So for example, I want to just start talking about how do you do all the different commands that you could do?
02:00As a root you could do also now with this user, but it's a little bit different
02:04You don't have immediate access to it
02:06But instead of having immediate access you have to type in always the word sudo before
02:12Now I want to show you an example and really this whole session this whole course is going to be about installing applications
02:17So let's see it
02:19Let's list out all the currently installed applications on this instance of our sentos of our installation
02:25to do that the command is yum and
02:28Yum is basically the repository of all the things that are installed and all the things that will be installed
02:34And I'm going to type inside here list because I want to list out all of the installed
02:40installed
02:41Not is installed
02:43installed
02:45And I want to list out all the installed applications
02:48you'll see that we're going to get a whole list of all the different applications and
02:53These are the applications that were installed on our system
02:57Now I don't want to and this is really the question of do you want to make the installs on behalf of this user?
03:04Or do you want to make those installs on behalf of the root?
03:07So it has like this more global everyone has access to it's kind of similar to when you're working on your system
03:14and you're
03:15Although my user has access to everything if I do commands as this user
03:21What I'm actually doing is I'm installing applications on my name in this user name
03:26What happens when this user name is deleted? What happens when?
03:30You really want to make sure that whenever you're doing a command that involves bigger picture
03:35You want to put the word sudo in front of it, and if I would do the same exact command sudo yum
03:41install not install sudo yum list installed and I do this command
03:47You'll see that now it's demanding a password because now I'm asking to do it as the root as the superior
03:53And although it's the same access level I have to type now my password to say yeah, I agree
03:59I want to get this as the root, and I would get the same information
04:03So literally the difference between the yum list installed and the sudo yum list installed is am I doing it on behalf of demo?
04:10Well am I doing this on behalf of the root?
04:13Alright, and usually when you're doing operations that are involved that involve the system in general
04:19You're gonna want to work with the sudo itself in the next session
04:23We're gonna start looking into actually installing a few things that we're gonna need before we do our next move

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!