RHCSA Rapid Track
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 toserveraasstudent.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$On
servera, switch torootusing sudo, converting to therootuser's shell environment.[student@servera ~]$sudo su -[sudo] password for student:student[root@servera ~]#Create the
operator1user 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/bashSet the password for
operator1toredhat.[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
operator2andoperator3. Set their passwords toredhat.Add the
operator2user. Set the password foroperator2toredhat.[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
operator3user. Set the password foroperator3toredhat.[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
operator1andoperator2user accounts to include theOperator OneandOperator Twocomments, respectively. Verify that the comments are successfully added.Run usermod -c to update the comments of the
operator1user account.[root@servera ~]#usermod -c "Operator One" operator1Run usermod -c to update the comments of the
operator2user account.[root@servera ~]#usermod -c "Operator Two" operator2Confirm that the comments for each of the
operator1andoperator2users 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
operator3user along with any personal data of the user. Confirm that the user is successfully deleted.Remove the
operator3user from the system.[root@servera ~]#userdel -r operator3Confirm that
operator3is 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/bashNotice that the preceding output does not display the user account information of
operator3.Exit the
rootuser's shell to return to thestudentuser's shell.[root@servera ~]#exitlogout[student@servera ~]$Log off from
servera.[student@servera ~]$exitlogout Connection to servera closed.[student@workstation ~]$