All right, so first we need to make sure that password validity is set to a maximum of 90
days for all new users.
Well, that will be vim on etc.login.devs.
Just look for the pass options, and there we can see pass max days currently set to
99,000.
Well, let's change that and make that 90.
Then we need to make sure that while creating users, an empty file with the name new file
is created to their home directory.
That will be touch etc.scalenewfile, which is taking care of it.
And next we are going to create some users.
So Anna, Anouk, Linda, and Lisa, let's do a quick shell loop for i in Anna, Anouk, Linda,
and Lisa, which is going to do an iteration over the range that I'm specifying here.
Do user at $idom.
And we do see that some of the users already exist.
That can be ignored here.
Then we set the password for Anna and Anouk to password.
So passwd, Anouk, and there we go, password going once and password going twice.
And just to be sure, let's set it for user Anna to pass the word SL, which is now done.
All right.
How about disabling the password for Linda and Lisa?
Well, if you do a grep Linda on etc.shadow, where Linda is just one of these users.
Ooh, Linda had a password, and we need to disable it.
How about Lisa?
Well, Lisa is a new user, so how does it work for new users?
The password field in etc.shadow starts with an exclamation mark, so it is disabled.
Now I need passwd, minus, minus, help.
I'm using minus, minus, help here because I don't know about you, but I don't lock passwords
on a daily basis.
So passwd minus L for user Linda, that should do it.
And if I do the grep again, then now we can see it still contains the original password,
but also the field starts with an exclamation mark, which has effectively disabled the password.
All right.
Time for the last part, create the groups, profs, and student.
So group add profs and group add students, going to do that.
And then we need usermod minus ag profs for Anna, as well as Anouk.
And something likewise, but this time the group name is students, and we do that for
Linda, and we also do that for Lisa.
And now we are good, and this was lesson 9.