When you create users, it makes sense
to think about default settings.
Particularly on the exam, if there's
any tasks that are related to users,
I would say read if there's any default settings
and take care of the default settings
before you are creating the users.
Now, there are two locations to set your default settings.
To start with, there's etclogin.devs.
For RHCSA, that's an important file.
Then there's files in etcscal.
etcscal is a skeleton directory, and files in this directory
are copied in the user home directory when you create them.
Now, for RHCSA, this is about all
that you need to know about user settings.
I will demonstrate in a minute.
And this more advanced option relates
to the Pluggable Authentication Modules, or PAM.
This is not an RHCSA topic, but I
know that if you are going to work with Red Hat in real life,
it's something that is very commonly required.
So alt-select is what you are going to use.
Alt-select is used as a front end
to manage PAM settings in a convenient way.
It works with profiles.
And if you use alt-select current,
you see the current profile.
And for this profile, you have features.
Use alt-select list features on your local profile
to show these features.
And if you think that a feature is convenient,
you can use alt-select enable features
to enable specific features.
As I told you, no alt-select here,
but we do need to talk about etclogin.devs and etcscal.
So the etclogin.devs file has a couple of parameters.
Many parameters are listed as not supported.
And that's because of PAM.
In the past, these parameters were all
in this configuration file.
Now it's a part of alt-select.
And you need alt-select enable feature
to enable specific features in PAM.
Now the thing that does matter is the password options.
So here you can see the different options.
Pass max date set to 99,999.
That means that by default, passwords
are valid for more than 200 years.
That might be a little bit much.
So maybe before you start creating your users,
you want to change this parameter.
Pass min dates is the minimal validity of your passwords.
And pass min len is the minimal length for passwords.
And pass warn dates is the amount
of days before the expiration of the password
that the user will get a warning.
I'm so happy that with a password that
is valid for more than 200 years,
the user at least will get a warning before the expiration.
Now notice that the parameter pass min len,
that applies to ordinary users.
It does not apply to the root user
when the root user is changing the password.
And that's because the root user, as discussed before,
is a kernel level user.
And restrictions like this only apply to ordinary users.
Pass max dates, that's a parameter
that we want to change, right?
So I'm going to set to 99 instead of 99,999.
Do keep in mind that the parameters that you can change
in the etc.login.devs apply to all new users
that you are going to create from this moment on.
They don't apply to currently existing users.
So if you want to change currently existing users,
you need to do that on an individual user basis.
You'll learn how to do that in the next video.
Before continuing, I would like to have a look
at the etc.scale directory.
That looks empty, doesn't it?
Well, it doesn't.
ls minus a is showing that here are some minimal environment
files for your user.
Now it's pretty easy.
If you want a file to be created for the user,
you create the file.
I'm using touch.
Touch allows you to create an empty file,
and in this case, an empty file with the name of file.
And the result is when I am going to use user
add to create a new user.
Let's create user bia.
And my user bia is created.
I'm sending a password for user bia.
And the password will be valid for 99 days only.
And also, user bia should have these files
in her own directory.
ls minus al will show that.
And there we go.
You can see that a file is there.
And when we do use till minus 5 on etc.shadow,
we can see that instead of the 99,999 for my existing users,
we see a 99 here.
And this 99 is the password expiration value.