Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to change the password for the current user.
Linux CLI
[1] Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
The 'passwd' command is used to change the password of a user in Linux.
2fill in blank
mediumComplete the command to change the password for user 'alice'.
Linux CLI
sudo passwd [1] Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
To change the password for a specific user, provide the username after 'passwd'.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding dashes before the username which causes errors.
Appending characters to the username.
✗ Incorrect
The username should be given without dashes or extra characters.
4fill in blank
hardFill 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'
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.
✗ Incorrect
The '-e' option followed by the username 'carol' expires the password immediately.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different usernames in the two commands.
Using '-e' instead of '-l' to lock the account.
✗ Incorrect
First lock the account with '-l' for user 'dave', then unlock it with '-u' for the same user.