Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Lab Using the passwd Command

Uploaded by

Brian K. Acevedo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lab Using the passwd Command

Uploaded by

Brian K. Acevedo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab: Using the passwd Command

Objective
In this lab, students will learn how to manage user passwords using the passwd
command in Linux. This command is essential for modifying user account passwords
and ensuring system security.
Equipment/Tools Needed
 Computer with Linux installed (Debian, Ubuntu, or a derivative)
 Terminal application

Content
1. Introduction to the passwd Command
The passwd command is used in Linux to change a user's password. By
default, only the user can change their own password, but the root user
(administrator) can change any user's password.
o Syntax:
passwd [username]
If no username is provided, it changes the password of the current user.
2. When to Use passwd
o Changing your own password.

o Changing other users’ passwords (as root).

o Managing password expiration and settings (admin use).

Step-by-Step Guide
Step 1: Change Your Own Password
1. Open the terminal.
2. To change your own password, use the passwd command:
passwd
3. You will be prompted to enter your current password and then your new
password twice to confirm it.
4. Once successfully changed, you will see a message that your password has
been updated successfully.
Step 2: Change Another User’s Password (Admin Use)
1. To change the password for another user, you must have root or sudo
privileges.
2. To change the password for a user, use the following command:
sudo passwd [username]
Example: To change the password for a user named john:
sudo passwd john
3. You will be prompted to enter your sudo password (the administrator
password).
4. Then, you will be asked to enter the new password for the user, followed by
confirmation.
5. The password will be updated for that user.
Step 3: Force a Password Change on Next Login (Admin Use)
1. As an administrator, you can force a user to change their password upon the
next login. This is useful if you want to ensure a user updates their password.
2. To do this, use the following command:
sudo passwd -e [username]
Example: To force john to change his password at the next login:
sudo passwd -e john
3. The user will be prompted to change their password the next time they log in.
Step 4: Password Expiry and Aging (Admin Use)
1. As an administrator, you can also set a password expiration policy for users.
2. To set a password expiry date, use the chage command:
sudo chage -E [YYYY-MM-DD] [username]
Example: To set a password expiration date for user john:
sudo chage -E 2024-12-31 john
This will set the password for john to expire on December 31, 2024.
3. To check the current password aging information for a user, use:
sudo chage -l [username]
Example: To check the password aging for john:
sudo chage -l john
Step 5: Practical Exercises
1. Change your own password
Run the passwd command and change your own password.
2. Change another user's password
As root or using sudo, change the password for a user (e.g., john).
3. Force a user to change their password at the next login
Use the passwd -e command to force a user to change their password.
4. Set a password expiration date for a user
Use the chage command to set an expiration date for a user's password.
5. Review the password aging information
Use the chage -l command to list the password aging details for a user.

Key Deliverables
 A log of all commands used during the lab.
 A list of users whose passwords were changed and expired.
 A brief explanation (150-200 words) on the importance of managing
passwords in Linux.

Rubric

Criteria Excellent (5) Good (4) Fair (3) Poor (1-2)

Correct use of Some incorrect


Minor errors in Multiple errors
Command passwd, chage, or incomplete
command usage in command
Accuracy and other related usage of
or syntax. usage.
commands. commands.

All password
management Most password
Some tasks are
tasks (change, tasks are
Password incomplete or Incomplete or
force change, completed
Management performed missing tasks.
aging) are correctly, with
incorrectly.
completed minor errors.
correctly.

Security Demonstrates Good Basic Little to no


Understandin excellent understanding, understanding, understanding
g understanding of with some minor lacking depth. of security
password details missing. concepts.
management and
Criteria Excellent (5) Good (4) Fair (3) Poor (1-2)

aging.

Well-organized log
Log is organized, Basic log with
Documentati with all actions Disorganized
but with minor some missing
on clearly or missing log.
gaps or errors. details.
documented.

Insightful
reflection on Good reflection Limited
Minimal or no
Reflection password with some reflection, lacks
reflection.
management in insights. depth.
Linux.

You might also like