0% found this document useful (0 votes)
18 views1 page

Week3.2 Exercises

This document provides instructions for managing users on a Linux system. It describes how to determine the current logged in user, examine the /etc/passwd and /etc/shadow files to understand user account fields, create new user accounts using useradd, set passwords, and view updated files. It also covers setting password and account expiration dates using chage, locking accounts with usermod, and resetting passwords.

Uploaded by

Freedom Alaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Week3.2 Exercises

This document provides instructions for managing users on a Linux system. It describes how to determine the current logged in user, examine the /etc/passwd and /etc/shadow files to understand user account fields, create new user accounts using useradd, set passwords, and view updated files. It also covers setting password and account expiration dates using chage, locking accounts with usermod, and resetting passwords.

Uploaded by

Freedom Alaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Managing Users

1. How do you determin which user you are logged in as?


2. Examine /etc/passwd and /etc/shadow, comparing the fields in each file, especially for
the normal user account. What is the same and what is different?
3. Create a user1 account using useradd.
4. Set the password for user1 to user1pw and then try to login again as user1.
5. Look at the new records which were created in the /etc/passwd, /etc/group and the
/etc/shadow files.
6. 6. Look at the /etc/default/useradd file and see what the current defaults are set to.
Also look at the /etc/login.defs file.
7. Create a user account for user2 which will use the Korn shell (ksh) as its default shell. (if
you do not have /bin/ksh install it or use the C shell at /bin/csh.) Set the password to
user2pw.
8. Look at /etc/shadow. What is the current expiration date for the user1 account?
9. Use chage to set the account expiration date of user1 to December 1, 2024.
10. Look at /etc/shadow to see what the new expiration date is.
11. Use usermod to lock the user1 account.
12. Look at /etc/shadow and see what has changed about user1’s password. Reset the
password to userp1 on the account to complete this exercise.

You might also like