Which Command Changes a User's Login Credentials?
Short answer
A sudo passwd
Question
Key Takeaways
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.
Common mistake: 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.
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
- https://man7.org/linux/man-pages/man1/passwd.1.html
- https://man7.org/linux/man-pages/man8/usermod.8.html
- https://man7.org/linux/man-pages/man1/chage.1.html
These links open the official vendor documentation in a new tab.
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.
Community Votes
83% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
BlackSkullz 👍 3 Answered AI'm assuming by "credentials" it's referring to the user's login credentials, which the passwd command specializes in
-
Monty97 👍 2 Answered AIt would depend on how you define credentials, but sudo passwd would be used to specifically change the password. sudo usermod would be used to change other attributes about the user account.
-
bongobo 👍 1to change a user's credentials: D. sudo usermod to change a user's password: A. sudo passwd
-
slots 👍 1 Answered Dsudo usermod
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.