Pre Test 2

1. Log in into your environment Lab

[student@servera ~]$ 

2. Before you begin, run the lab login rhlsa command to login your account. Credentials for login is same with your registered credentials in this platform (Adinusa).

[student@servera ~]$ lab login rhlsa

3. After login, run the lab start prbt-001-2 command. This command runs the start script and pre-configures your lab environment.

[student@servera ~]$ lab start prbt-001-2

4.Switch to root using sudo, converting to the root user's shell environment.

[student@servera ~] $ sudo su -
[sudo] password for student: student
[root@servera ~]#

5. Create the operator1 user and confirm that it exists in the system.

[root@servera ~]# useradd operator1
[root@servera ~]# tail /etc/passwd | grep operator1

6. Set the password for operator1 to redhat.

[root@servera ~]# passwd operator1
Changing password for user operator1.
New password: redhat
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: redhat
passwd: all authentication tokens updated successfully.

7. Switch to operator1 user, and try the sudo command, it should fail.

[root@servera ~]# su - operator1
[operator1@servera ~]$ id
uid=5002(operator1) gid=5002(operator1) groups=5002(operator1) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[operator1@servera ~]$ sudo su -
[sudo] password for operator1: redhat
operator1 is not in the sudoers file.  This incident will be reported.

8. Create file operator1 in /etc/sudoers.d/ directory,

[operator1@servera ~]$exit
[root@servera ~]# vim /etc/sudoers.d/operator1

with the following content

operator1 ALL=(ALL) ALL

9. verify that the file has been created, and take a screenshot, then name the screenshot with.

[root@servera ~]# cat /etc/sudoers.d/operator1
operator1 ALL=(ALL) ALL

10. And Switch to operator1 user, try the sudo command, and take a screenshot, then name the screenshot with.

[root@servera ~]# su - operator1
[operator1@servera ~]$ sudo su -
[sudo] password for operator1: redhat
[root@servera ~]#