In: Computer Science
Goal: in this lab, you will learn to configure sudo to allow a
user mrussell to change
password for users. Please follow the steps and answer all the
questions at the end of
the lab instruction.
In the Linux machine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. For this part you will need a 2nd normal user
(non-root) account. If you don't have
an account for "auser" with password “room1202” yet, you can create
one by
running (as room1202):
$ sudo useradd -c "A User" auser
$ sudo passwd auser
2. Login as room1202, run the $ sudo visudo to
edit the configuration file for sudo
to allow a normal user account (mrussell is used below) to change
passwords for
users. The new entry should look like this (tab key as column
dilimeter):
mrussell ALL = /usr/bin/passwd
3. Login as mrussell. What happened, if you use
passwd to try to lock the account
for auser as follows:
$ passwd -l auser
4. Now try it again using sudo. This is done by
running the command as normal
but with the word sudo in front:
$ sudo passwd -l auser
What output did you see from sudo? Did you lock the account this
time? (Check
with sudo passwd -S auser.)
5. Try to unlock the account without using
sudo:
$ passwd -u auser
What output did you see this time? Is the account unlocked
now?
6. Unlock the account using sudo. What happened
this time?
7. Using what you have learned about finding and
reading system documentation,
enable the user mrussell to run the following command
$ sudo sudoedit /etc/hosts
Questions:
1. What file does the command visudo actually edit? (20pts.)
2. Compare the outputs from step#3 with those from step#4. What
caused the
difference? (20pts.)
3. What output did you see in step#5? Then run sudo passwd –S auser
and descript
what you see. (20pts.)
4. What output did you see in step#6? Then run sudo passwd –S auser
and descript
what you see. (20pts.)
5. Save a screenshot in your report to prove that, on your system,
you have
successfully completed step 7. (20pts.)
Answer 1
*************
Answer 2
****************
Answer 3
**************
Answer 4
***************
Answer 5
************
Answer 5 6
**************
without sudo command some system files not allowed except root user
Answer 7
*****************
1)
/etc/sudoers.tmp
2) user will get locked out with sudo user only
3) it changes the flag to L[lock flag] instead of P
4) it shows the state of the user
Thanks