All right.
Lab solution.
So where am I going to start?
I'm starting with the sudo shell.
And in the sudo shell, I'm going to add etc sudoers.d.ana.
And what am I going to put in this NFL?
Well, this is the part where you need
to remember what you want to do.
And honestly, if you don't remember,
just give it to visudo.
And I would advise to look for wheel.
Here, this line wheel is a nice placeholder.
And I like to copy it over and edit it
so that I don't have to make any syntax errors in the file
that I'm going to create.
Now, of course, we are not going to do this for wheel.
But we have the placeholder of what is needed.
And in this placeholder, I'm going to add user ana.
And all is all.
Well, what can she do?
Well, she can use user bin passwd and not user bin passwd
root.
Did you notice the order, by the way?
Normally, you go from specific to generic.
Here, you go from generic to specific.
So you have the generic definition
that the user can use user bin passwd,
but not user bin passwd root.
If you inverse the order of these lines,
it's not going to work.
Then, sudo edit, but not sudo edit of etc sudoers.
And that should be doing it.
So of course, you want to test.
Do I even have a user?
And I'm not sure about it.
Let's create a user, user add ana.
By the way, if you're on Ubuntu, you
can use user add minus m to make a home directory,
minus s for bin bash as a shell, and minus u
if you want to give the user a user ID as well on user ana.
Yes, on Linux Plus, you need to be aware of command line
options like this, so it never hurts
to show you how to use them.
Good.
Next, I'm going to set a password,
so passwd for user ana.
Going once and going twice.
And now I can open a subshell as user ana
and use sudo passwd linda.
And ana is entering the password and is
prompted for a new password, so that is working out all right.
And that is what needed to be done in this lab.
That's all.
Let's continue with lesson two.