Which command would you use to change a user's password?

Prepare for the LPI Linux Essentials Exam with our comprehensive quiz. Study with interactive flashcards and multiple choice questions, with detailed hints and explanations for each. Ace your exam with confidence!

The command used to change a user's password in a Linux system is passwd. When you run this command followed by a username, it allows you to set or alter the password for that specific user account. If used without a username, it will prompt the currently logged-in user to change their own password. This makes passwd a fundamental command for user account management in terms of maintaining security and managing access via passwords.

The other commands listed serve different purposes. useradd is used for creating new user accounts, which is essential at the commencement of setting up user access but does not involve changing existing passwords. The deluser command is used for removing user accounts entirely from the system, so it does not apply to the context of modifying passwords. Similarly, usermod is utilized for modifying a user account's attributes (such as username or user ID) but is not specifically designed for changing passwords. Hence, passwd is the most appropriate command for the task of changing a user's password.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy