0
0
Linux CLIscripting~10 mins

passwd (change password) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to change the password for the current user.

Linux CLI
[1]
Drag options to blanks, or click blank then click option'
Apasswd
Bchpasswd
Cuseradd
Dusermod
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'useradd' which is for adding users, not changing passwords.
Using 'usermod' which modifies user properties but not passwords directly.
2fill in blank
medium

Complete the command to change the password for user 'alice'.

Linux CLI
sudo passwd [1]
Drag options to blanks, or click blank then click option'
Aroot
Bguest
Cadmin
Dalice
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'root' or other usernames instead of the target user.
Omitting the username when changing another user's password.
3fill in blank
hard

Fix the error in the command to change the password for user 'bob'.

Linux CLI
sudo passwd [1]
Drag options to blanks, or click blank then click option'
A--bob
B-bob
Cbob
Dbob-
Attempts:
3 left
💡 Hint
Common Mistakes
Adding dashes before the username which causes errors.
Appending characters to the username.
4fill in blank
hard

Fill both blanks to create a command that forces password expiration for user 'carol'.

Linux CLI
sudo passwd [1] [2]
Drag options to blanks, or click blank then click option'
A-e
Bcarol
C-f
D-l
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-f' which forces password change on next login but is less common.
Using '-l' which locks the account instead of expiring the password.
5fill in blank
hard

Fill all three blanks to create a command that locks the account for user 'dave' and then unlocks it.

Linux CLI
sudo passwd [1] [2] && sudo passwd -u [3]
Drag options to blanks, or click blank then click option'
Adave
B-l
D-e
Attempts:
3 left
💡 Hint
Common Mistakes
Using different usernames in the two commands.
Using '-e' instead of '-l' to lock the account.