Creating Users and Groups in Linux Demo
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
1 hour 41 minutes
Hey, everyone, welcome back to the course. So in this video, we're gonna show you a brief demonstration of using Lennox. So we're basically gonna be creating some users and will also create a group. And then we'll add those users to that group. So this is really just to kinda show you some fundamental things you might be doing as a system administrator. So this just gives you an idea of
some of the command you might use in Lennox. Now, in the real world, we typically don't individually create a user, so we won't be coming to the command line and doing this. But I wanted to show you some basic Lennox command. So first things first we need to get root on this machine. So we're gonna put in our S u space dash and then the password
here and we get route on the machine. Next, we're going to use the user add command
to create a user, Tomeka.
All right, Next up, we're gonna go ahead and create a password for Tamika. In this case, we're just gonna use password with a capital P and use a zero instead of an O because we're using a dictionary. Word is gonna give us this message. We don't care about that because we're in a virtual machine lab environment. Typically, you obviously want a stronger password. So now we've created a password for Tomeka.
So next we're gonna set an expiration date for the account we just created. We're gonna use the user modification command here, and we're just going to specify a date near the end of 2021 for our account, Tomeka.
Alright. So next week and go ahead and enter command to actually lock these recounts. So let's say that to make it was a contractor doing some auditing or something. And now that she's done with her audit, we wanna lock her account so she can no longer access it.
So we're gonna use user modification, do the dash capital L command, and then we use her name
to lock that particular account.
We could also force her password to expire immediately. So using the Chad command here, we could force that user account password to expire immediately.
And then if we want to delete out to make his account, we could go ahead and use the user, delete command
and that will delete that particular user account.
Alright, so next let's go ahead and create some new users here. So we're gonna use a user add command again,
and this time we're gonna create a user called Monte. We're gonna creating three users here, and then we'll add them to a new group that we create.
So we use user add Monsey, the other two users. We're gonna be Bob and Alison.
So just like we did with Tameka, we're gonna use user add.
We'll put the specify the name of the user, which, in this case, this Muncie and then we'll also go ahead and create a password for this user account.
So if you recall we use a password command here and then just specify the user account, it's gonna ask us for the new password again, we're just gonna use that password with a Capital P and the number zero instead of an O. Because it's a dictionary word. As I mentioned before, we're gonna get that air message. And then we just confirmed that same password again. We're using a week password here because it doesn't really matter,
since we're in a lab environment.
So next up. Let's create a user account, Bob. So, user, add command again than Bob. And then we'll go ahead and create his password as well.
And to do that, we just use a password command, put the user account there is gonna ask us for the new password. We're gonna use that exact same password for the password. We'll get our same air message here, and we'll re type that same password in. So now it's gone ahead and created Bob's account.
So finally, we're gonna go ahead and create Alison's user accounts. So the same thing here, User add command using Alison and then same password that will create for Alison as well.
Alright, so we'll type in our password. Command here will specify the user account again. Type in that same password again, password with Capital P with a zero instead of an O. And we'll go ahead and confirm our password. And then now we've created that for Alison. So we created our Monsey Bob and Alison user accounts.
The next thing we're gonna want to do is go ahead and create that group. And then, like I said before, we're gonna add those three users we just created through the group. So to create the new group, we're gonna use the command group ad.
We're going to specify a group number which in this case is 11,000 and then we'll specify a group name which, in this case, we'll just do Sai Buri.
Alright, so we've created the group. Now we're gonna add each of those users to the group. So we're gonna use that user modification command again and we're gonna do the ad group and we'll name the group, which is cyber. And then we'll specify the user that we want to move into that particular group, which in this case is Monsey.
We're gonna follow the same step for every single one of our users. Now,
one thing we could do it with the command line. We could express the up arrow and it will bring back the previous command. So we want to type all that in again. We could just change the name for the different user accounts. So in this case will type Bob in there, and that will create an ad bob to that user group that we just created
that will do the up arrow again and we'll go ahead and add Alison into that group too,
right? So we've added the users in there, but we can't really tell, right? So we need to figure out how can we identify that these users have actually been added to the group?
What? We're gonna use this the I d command for each of these users and just confirm now what you're gonna notice here. Sir, Monty is part of a couple of different groups, but you notice group 11,000. Sai Buri is also a group that months he's in, and that's the one with that. We just added Monsey too.
So we know we were successful there. Same thing with Bob. We see that Group 11,000 or Sigh. Berry is a group that Bob is a part of and saying with Alison as well. So we know that we were successful in adding these users to that new group that we had created.
Now let's say that we want to create the group or delete a group without actually deleting those user accounts. We just want to remove them from the group. We could do that. We could do that with the group delete command
So we're typing group delete and then to specify the group we want to delete and that will delete the cyber regroup
from our system.
And again, we just want to check our work. So we're gonna use that I d command again and just see what groups these users are a part of to confirm that they have been removed from that cyber regroup. So we I d monte here we see that No longer is Monsey a part of that cyber regroup, because again we just deleted that group. Same thing with Bob. You don't see that cyber regroup anymore. And again, if we test Alice here, you'll also see that there is no group Sai Buri. For that Alice is assigned to anymore.
So in this video just showed you some basic Lennox command you can do. We just created some new users out of those users to a group, deleted a user and also deleted a group. These were just some very basic commands, but gives you a little taste of some of the things you might be doing as a system administrator.