What command should I run after making changes to /etc/passwd file

etcpasswordusers

I have made some changes to /etc/passwd file ,now I wanted to see if the effect of changes taken place or not .What command should I run for that.

For example after making change to /etc/ssh/ssh_config file ,I run /etc/init.d/sshd command.

Best Answer

To verify the passwd and corresponding shadow file, use pwck. To verify the group and corresponding gshadow file, use grpck. See the manpages for the details of the actions they perform.

Hand-editting of /etc/passwd is best done (if at all) with vipw and vipw -s for the shadow file. For the /etc/group and /etc/gshadow use vigr and vigr -s, respectively. Using these tools provide not only a lock to prevent multiple, concurrent user updates but also offer validity checking.

In general, modifications to the password and group files are best made using the standard user(add|mod|del) and group(add|mod|del) tools.

Related Question