Understanding and Using Access Levels
A new user by default can only access there own files. We want to be able to define higher level of access to our user do do that we will enter the visudu file (located at /usr/sbin/visudu) and add a new rule for our user :
USERNAME ALL=(ALL) ALL
We will dive into what this means in the video above.
Video Transcript
00:00In our last lesson, we learned how to create users and how to remove them.
00:05In this session, we're going to learn how to give access rights to our users that were
00:09created.
00:10So we're also going to learn about one more thing really small is when you actually type
00:14clear, in your terminal, it'll just clean out the window, it's just an easier view
00:18so I don't have so much clutter.
00:20We're done with that topic.
00:22In between videos from now on, once in a while, I'm just going to type clear without
00:25saying anything because I want to have a nice clean window.
00:29All right, so now that we're back, let's create our first user again.
00:33I'm going to go right ahead and type your add user.
00:37I'm going to give this user a name.
00:39I'm going to call him demo and I'm going to give that user a password.
00:52All right, so we gave a password.
00:53Now we have a new user with a password.
00:55Fantastic.
00:56The next step for us, what we want to do is we want to give this user a super
01:00power and the super power we want to give it is the power to actually edit
01:05himself, edit himself, but have access, root access to the system.
01:11The way we give root access to this user is by going into a file configuration
01:17and adding that user into that file as we're still the root user.
01:22We're going to go into that file and add a new user, basically saying,
01:25hey, this user has root access as well.
01:28Now, the steps involved with that involve us using an editor that's called V.
01:33It's a very complicated editor.
01:36We're not going to go into the into the depths of how to use it,
01:39but we're going to teach you just a few commands so you could get familiar
01:43with using V. So let's see how it works.
01:46First of all, we're going to go right ahead into our actual into the actual
01:50file that we're talking about.
01:51So to do that, I'm going to type slash because I want it.
01:53I don't want to be in my current folder that I'm in.
01:56I want to go all the way to the bottom folder of the application.
01:59And I'm going to type your user and I'm going to go into the file
02:02S been. And by the way, as I'm typing, you could always type tab.
02:08And if there is no competing name, it will automatically fill it up.
02:12And what I mean is if I typed your S and now I type tab, nothing will happen
02:17because there's more.
02:18There are more things besides one folder that is called S.
02:23But as soon as I type SB, there is only one folder like that.
02:27So I could type tab and will automatically fill the S been folder.
02:31Now, the file itself isn't is located in the user S been folder.
02:36And the file itself is called Visudu.
02:39Once we're in the Visudu file, I'm just going to type enter here.
02:42We're going to be in the V editor.
02:44Now, the V editor looks a little bit weird because it is a bit weird.
02:48You can't just go ahead and start typing.
02:50Don't even try because every single letter is a shortcut
02:53and you might create some damage that is unchangeable
02:56or at least you won't know how to undo what you did.
02:59So really follow my command here and don't do anything
03:02but what I tell you at this stage until you get more familiar
03:05with how to work with it.
03:07All right. So the first step that I'm going to do,
03:09I'm going to use the arrows to just go down
03:11and I'm going to scroll all the way down to the area of the user.
03:16So I'm just going to scroll, scroll, scroll all the way down
03:19until I reach the until I reach my allow people in group wheel
03:24or allow route to run any command anywhere.
03:28So you can see that the root user has root command anywhere
03:33and we're going to see in two videos on this video,
03:35we're going to see how do you add another user
03:36that has this level of access and in the next video,
03:40we're going to see how do we add a super group
03:42and then assign users into that super group.
03:46OK, so the next now that we're in the editor,
03:48we're in the right line.
03:49We found this area where it says allow route
03:52to run any command anywhere.
03:53And you see that the route is there.
03:55Obviously, never delete this because if your route
03:57doesn't have access, you have no access at all.
04:00So definitely don't delete that.
04:01That would be very, very dangerous.
04:03No typos there, very dangerous.
04:06All right, so now go a line underneath it
04:08and type the letter A. When you type the letter A,
04:12you'll notice that now you're in insert mode.
04:15And now that you're in insert mode,
04:17you could type whatever you want.
04:19So now that we know that our user is called demo,
04:21I'm just going to type your demo
04:24and I'm going to add the same level of access,
04:27which is all, all, all.
04:30And that's going to give me access to that demo user as well
04:34to be the same access level as route itself.
04:37So I'll be able to edit files that are not mine
04:39because I have access to everything.
04:42All right, now before we're done with this,
04:45we have to save it.
04:46Now it's a little bit complicated,
04:47but the first step in saving
04:49is we have to get out of the insert mode.
04:51To get out of the insert mode,
04:53I'm going to type on escape.
04:55Once I type the escape button,
04:57you'll see that now the insert is gone
04:59and it's time for me to save.
05:01Now, if I made any mistake, which is quite plausible,
05:05I don't want to save anything.
05:06I just want to exit.
05:07Now you might want to just close up immediately
05:09and start crying because there is no one button
05:13that enables you to exit.
05:14But the way you exit without saving is by typing colon.
05:20And you see how we're dropped to the bottom of the screen
05:22now and you see this green highlighting area.
05:25And now I'm going to type Q for quit
05:28and shift one to have that marker, the command marker.
05:34And I'm going to type enter to execute that command.
05:38And you can see that Visuru was not changed.
05:40We didn't make any changes to our Visuru file.
05:44Now let's do it again, but this time we want to change it.
05:46So I'm going to, I could type everything again,
05:49just like we did before the user has been Visuru.
05:53Or if you use your up and down arrows, if you click on up,
05:56you'll get the last command you've typed onto your system.
06:00Very, very handy, very useful.
06:02So I'm just going to click on the up button
06:04and I'm going to click enter.
06:05And again, I'm inside of Visuru.
06:06I could click on the A for the edit from the beginning
06:09and I could scroll around with an arrow.
06:12I'm really just in a regular editor mode, which is fantastic.
06:15You don't have to learn
06:16all the different commands of Visuru.
06:18You could just manually do this.
06:19And that's what I recommend you do in the beginning
06:21until you get used to things
06:23until you want to learn more about Visuru.
06:25So now I'm going to type enter
06:26and just make sure when you're doing all these stuff
06:28that you're in insert mode, which is what I'm at.
06:31And I'm going to add the user demo again.
06:33And again, I'm just going to type the same exact access
06:36access level that my root has.
06:38And now I'm going to have a super user
06:40that is basically a root.
06:43And again, I'm going to click on escape
06:44because I'm done editing, but this time around
06:47what I want to do is I want to save my changes.
06:49To save my changes, I'm going to click on a shift
06:52and then I'm going to click on ZZ together.
06:55So I'm going to keep my shift
06:57and I'm going to click ZZ fast.
07:00Once I do that, it's going to save my Visuru file.
07:03So shift ZZ keeping the shift pressed,
07:06typing ZZ twice will save my Visuru.
07:10And now my Visuru file is saved.
07:11And now my user demo is going to have the same access,
07:15right, as our root.
07:19In the next video, I want to show you
07:21if you are planning on making more than one user
07:24that's going to be a super user,
07:26how could you create a grouping
07:29and basically put all these super group users into a group?
07:33So for example, if you have a few developers
07:34and you want all of them to have the same root access
07:37or any other type of access
07:39as you learn to create different accesses,
07:43how do you do it?
07:44How do you add one group
07:45and then add all these users into that group?
07:47So we're going to look into that in the next video.
