In this video, I'll show you how to create and manage users.
And there's a couple of commands that is involved.
User add allows you to create user accounts.
And user mod allows you to modify user accounts.
And guess what user del is doing?
That's right.
It allows you to delete user accounts.
And after creating your users, you probably
want to have a password as well.
Well, passwd is how you manage passwords for your users.
Let me show you.
So I'm going to use user add to add a new user.
Well, user add has many options.
And let's check out some of these options.
Oh my goodness, that is really a lot.
Some of these options are options that you never use.
Some of these options are important.
You'll later learn about groups.
Let's all do that now because I haven't properly
explained groups.
You do not have to specify minus m
to ensure that the user gets the home directory.
Some distributors, that is required, not on Red Hat.
Password.
Don't misunderstand this as an option to set a password
because you need to pass an encrypted
password of the new account.
And that, in fact, is not a very convenient option.
The options that you are going to like
are minus s and minus u to set the shell and the user
ID of your new user.
But you can also just use user add.
So let me use user add lorry.
And that will create user lorry.
And when I use still minus 1 on etc pass wd,
you can see the result. Pretty boring.
The user is created.
The user has a home directory.
And that is all.
Now, if your user is required to log in as well,
well, we need to make sure that we set the password.
Because still minus 1 on etc shadow
is showing that right now, poor lorry has an exclamation mark,
so we'll never be able to log in.
So when I use pass wd for this user account,
I can enter the password once.
And I can enter the password twice.
And now use the lorry as an encrypted password.
Fun fact, if we do till for the last three users,
I can tell you that for all of my users,
I'm using the password password.
What I want to show you here is that the hash
of the encrypted password is different for all
of these users.
And that is how these user accounts are really secured.
And you don't have to worry about anything.