010-160 · Question #80
Which of the following tasks can the command passwd accomplish? (Choose two.)
The correct answer is B. Change a user's password. E. Lock a user account. The passwd command is used to change a user's password and can also lock or unlock accounts using its administrative options.
Question
Options
- AChange a user's username.
- BChange a user's password.
- CCreate a new user account.
- DCreate a new user group.
- ELock a user account.
How the community answered
(39 responses)- A3% (1)
- B95% (37)
- C3% (1)
Why each option
The passwd command is used to change a user's password and can also lock or unlock accounts using its administrative options.
Changing a username is performed with the usermod -l command, not passwd; passwd has no option to modify a login name.
The primary function of passwd is to update a user's authentication token (password) stored in /etc/shadow, and any user can change their own password while root can change any user's password.
Creating new user accounts is the function of the useradd (or adduser) command, not passwd.
Creating new groups is the function of the groupadd command, not passwd.
passwd -l locks a user account by prepending an exclamation mark to the password hash in /etc/shadow, preventing password-based login without deleting the account.
Concept tested: passwd command password management and account locking
Source: https://www.man7.org/linux/man-pages/man1/passwd.1.html
Topics
Community Discussion
No community discussion yet for this question.