Which Command Changes a User's Login Credentials?
A systems administrator received a request to change a user's credentials. Which of the following commands will grant the request?
Community Votes
83% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The test checks whether you know that 'credentials' in this context specifically means the password, and the trap is mistaking usermod—which modifies account properties but not the login password—as the right answer.
This Linux exam question asks which command changes a user's credentials, with community consensus favoring sudo passwd for altering login passwords. The debate highlights the difference between password changes and broader account attribute changes.
Choosing D (sudo usermod) is the most common wrong answer because usermod does modify user accounts, but it does not directly change the login credential (password); passwd is the dedicated command for that.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
sudo passwd is the command designed to update a user's login password, which is the fundamental credential used for authentication. When a request to change a user's credentials is made, it typically means resetting or updating that password. The community comments reinforce this: comment [1] states 'the passwd command specializes in' login credentials, and comment [2] explicitly distinguishes password changes from other account attribute changes.
Why the Other Options Are Wrong
Option B (userdel) deletes a user account entirely, which is not a credential change. Option C (chage) manages password aging and expiry policies, not the password itself. Option D (usermod) changes account attributes like home directory, group membership, or UID, but it does not set the password; using usermod -p would set an insecure plaintext password, so it is not the intended tool. The comments note that while 'credentials' could be interpreted broadly, the exam's expectation is the password.
Community Comment Notes
Comment [3] succinctly summarizes the ambiguity: 'to change a user's credentials: D. sudo usermod to change a user's password: A. sudo passwd.' However, the exam likely uses 'credentials' as a synonym for 'password,' and the suggested answer is A. Comment [4] votes D, but the majority of votes (83 vs 17) and the suggested answer support A.
Official Reference
Exam Strategy
When a Linux question asks about changing 'credentials,' immediately think of the passwd command; it is the standard tool for password changes. Remember that usermod is for account attributes, not passwords, and avoid overthinking broad definitions of 'credentials' unless the question explicitly mentions other fields.