The best way to edit /etc/passwd, or shadow or group file is to use vipw command. Traditionally (under UNIX and Linux) if you use vi to edit /etc/passwd file and same time a user try to change a password while root editing file, then the user’s change will not entered into file.
What does * mean in shadow file?
A password field which starts with a exclamation mark means that the password is locked. The remaining characters on the line represent the password field before the password was locked. So * means no password can be used to access the account, and !
Can I modify etc passwd?
There is no such command to apply changes from /etc/passwd file. If user which details you’ve changed is logged in, it should just relogin to apply the changes.