nerdexam
LPI

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.

Security and File Permissions

Question

Which of the following tasks can the command passwd accomplish? (Choose two.)

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)
  • A
    3% (1)
  • B
    95% (37)
  • C
    3% (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.

AChange a user's username.

Changing a username is performed with the usermod -l command, not passwd; passwd has no option to modify a login name.

BChange a user's password.Correct

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.

CCreate a new user account.

Creating new user accounts is the function of the useradd (or adduser) command, not passwd.

DCreate a new user group.

Creating new groups is the function of the groupadd command, not passwd.

ELock a user account.Correct

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

#passwd command#user management#account locking#password change

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice