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

Study for the LPI Linux Essentials Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

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

Explanation:
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.

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