Which command do you use to edit password file in Linux?

LinuxWord

1 answer

Answer

1169368

2026-04-28 15:25

+ Follow

Hmm... The recommended method of changing your passWord on Linux (or Unix for that matter), is to use the passwd command.

To change another user's passWord, switch user to rootand issue the command:

# passwd other_user

Linux
Linux

Your question seems to indicate that you really want to directly edit your passwd and shadow files on your Linux distribution. Unless you really, really know what you're doing, I recommend against this.

If you do know what you're doing, use the vi (or other editor - vi is the best editor ever made though) editor and directly edit your /etc/passwd and /etc/shadow files.

Of course, should you subsequently discover you can no longer access your system, it may behoove you to go back to your Linux/Unix basics and begin all over again. May I suggest, as an Excellent starting point, learn all that you can about the world's most wonder editor, the editor vi. :)

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.