CompTIA Linux+ Guide to Linux Certification (4th Edition) Chapter 10, Problem 6D
ID: 3777393 • Letter: C
Question
CompTIA Linux+ Guide to Linux Certification (4th Edition)
Chapter 10, Problem 6DE (Discovery Excercise)
6. Write commands to accomplish the following (use the manual or info pages if necessary):
a. Create a user with a login name of bsmith, a UID of 733, a GECOS field entry of “accounting manager,” and a password of Gxj234
b. Delete the user jdoe, but leave the home directory intact
c. Change the properties of the existing user wjones such that the user has a new comment field of “shipping” and an account expiry of March 23, 2022
d. Lock the account of wjenkins
e. Change the password of bsmith to We34Rt
f. Change the properties of the existing user tbanks such that the user is a member of the managers group and has a login name of artbanks
g. Create a user with the same UID and primary group as root and a login name of wjones
h. Create a new user with a login name of jdoe who has a password of he789R and no home directory
i. Change the primary group of the user wsmith to root
j. Add the users tbanks and jdoe to the group acctg
Explanation / Answer
a. useradd -c "accounting manager" -u 733 -p Gxj234 bsmith
b. userdel jdoe
c. usermod -c "shipping" -e 2022-03-22 wjones
d. You can lock the account in two ways
1. By locking the password
passwd -l wjenkins
2. By setting expiry of the useraccount using usermod command
usermod -e yyyy-mm-dd wjenkins
e. To change the password of the user , use the following command
passwd bsmith
Note: to execute all of the above commands you should be a super user.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.