0
0
Linux CLIscripting~20 mins

passwd (change password) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Password Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Output of passwd command with expired password
What is the output when running passwd -e username on a Linux system?
Linux CLI
passwd -e username
AError: User 'username' does not exist.
BPassword expiry information changed.
CUsage: passwd [options] [username]
DPassword successfully changed.
Attempts:
2 left
💡 Hint
The -e option forces password expiration for the user.
💻 Command Output
intermediate
1:30remaining
Result of passwd command with invalid option
What error message appears when running passwd -z on a Linux system?
Linux CLI
passwd -z
A
passwd: invalid option -- 'z'
Try 'passwd --help' for more information.
Bpasswd: option requires an argument -- 'z'
CPassword successfully updated.
Dpasswd: unknown command 'z'
Attempts:
2 left
💡 Hint
Check how passwd handles unknown options.
🔧 Debug
advanced
2:00remaining
Why does passwd fail with 'Authentication token manipulation error'?
You run passwd to change a user's password but get the error: Authentication token manipulation error. What is the most likely cause?
AThe system is out of disk space on the root partition.
BThe /etc/passwd file is missing from the system.
CThe user is not in the sudoers file and lacks permission to change the password.
DThe password entered does not meet complexity requirements.
Attempts:
2 left
💡 Hint
Consider permissions needed to update password files.
🚀 Application
advanced
2:00remaining
Automate password expiration for multiple users
You want to expire passwords for users alice, bob, and carol using a single shell command. Which command correctly does this?
Apasswd -e $(alice bob carol)
Bpasswd -e alice bob carol
Cpasswd -e alice && passwd -e bob && passwd -e carol
Dfor user in alice bob carol; do passwd -e $user; done
Attempts:
2 left
💡 Hint
Think about how to run a command multiple times in a loop.
🧠 Conceptual
expert
1:30remaining
Understanding passwd password aging options
Which passwd option sets the minimum number of days before a user can change their password again?
A-n
B-w
C-x
D-i
Attempts:
2 left
💡 Hint
Minimum days means how soon after a change the password can be changed again.