In this exercise, you will create several users on your system and set passwords for those users.
Outcomes
You should be able to configure a Linux system with additional user accounts.
Log in to workstation as student using student as the password.
On workstation, run lab users-manage start to start the exercise.
This script ensures that the environment is set up correctly.
[student@workstation ~]$lab users-manage start
From workstation, open an SSH session to servera as student.
[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$
On servera, switch to root using sudo, converting to the root user's shell environment.
[student@servera ~]$sudo su -[sudo] password for student:student[root@servera ~]#
Create the operator1 user and confirm that it exists in the system.
[root@servera ~]#useradd operator1[root@servera ~]#tail /etc/passwd...output omitted... operator1:x:1002:1002::/home/operator1:/bin/bash
Set the password for operator1 to redhat.
[root@servera ~]#passwd operator1Changing password for user operator1.New password:redhatBAD PASSWORD: The password is shorter than 8 charactersRetype new password:redhatpasswd: all authentication tokens updated successfully.
Create the additional users called operator2 and operator3.
Set their passwords to redhat.
Add the operator2 user.
Set the password for operator2 to redhat.
[root@servera ~]#useradd operator2[root@servera ~]#passwd operator2Changing password for user operator2.New password:redhatBAD PASSWORD: The password is shorter than 8 charactersRetype new password:redhatpasswd: all authentication tokens updated successfully.
Add the operator3 user.
Set the password for operator3 to redhat.
[root@servera ~]#useradd operator3[root@servera ~]#passwd operator3Changing password for user operator3.New password:redhatBAD PASSWORD: The password is shorter than 8 charactersRetype new password:redhatpasswd: all authentication tokens updated successfully.
Update the operator1 and operator2 user accounts to include the Operator One and Operator Two comments, respectively.
Verify that the comments are successfully added.
Run usermod -c to update the comments of the operator1 user account.
[root@servera ~]#usermod -c "Operator One" operator1
Run usermod -c to update the comments of the operator2 user account.
[root@servera ~]#usermod -c "Operator Two" operator2
Confirm that the comments for each of the operator1 and operator2 users are reflected in the user records.
[root@servera ~]#tail /etc/passwd...output omitted... operator1:x:1002:1002:Operator One:/home/operator1:/bin/bash operator2:x:1003:1003:Operator Two:/home/operator2:/bin/bash operator3:x:1004:1004::/home/operator3:/bin/bash
Delete the operator3 user along with any personal data of the user.
Confirm that the user is successfully deleted.
Remove the operator3 user from the system.
[root@servera ~]#userdel -r operator3
Confirm that operator3 is successfully deleted.
[root@servera ~]#tail /etc/passwd...output omitted... operator1:x:1002:1002:Operator One:/home/operator1:/bin/bash operator2:x:1003:1003:Operator Two:/home/operator2:/bin/bash
Notice that the preceding output does not display the user account information of operator3.
Exit the root user's shell to return to the student user's shell.
[root@servera ~]#exitlogout[student@servera ~]$
Log off from servera.
[student@servera ~]$exitlogout Connection to servera closed.[student@workstation ~]$