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.
To verify the
passwd and corresponding
shadow file, use
pwck. To verify the
group and corresponding
gshadow fiile, use
grpck'. See the manpages for the details of the actions they perform.
/etc/passwd is best done (if at all) with
vipw -s for the
shadow file. For the
vigr -s, respectively. Using these tools provide not only a lock to prevent muultiple, concurrent user updates but also offer validity checking.
In general, modifications to the password and group files are best made using the standard
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. If not, they will be immediately available after login.
This is because login reads details from passwd file during login and keeps it in memory until logout.
I had success with the
update-passwd command after I manually edited the /etc/passwd file on Debian-based systems (e.g. Ubuntu). I know this is NOT the intended use of this command, but it works for this purpose, too. See its man page for more deatails: http://manpages.ubuntu.com/manpages/precise/man8/update-passwd.8.html
On Red Hat / CentOS based systems I did not find an equivalent command, on those systems I had to do a system reboot to make the changes take effect.
As somebody already mentioned, it is best not to edit the /etc/passwd file manually. Instead I use useradd / userdel / usermod commands whenever possible. The only valid reason for editing the /etc/passwd and /etc/group files IMO is when I need to copy over a lot of accounts from another system. After adding e.g. a 100 accounts this way, I usually do a full system reboot. Also, when you manually edit /etc/passwd and/or /etc/groups files you must not forget to edit the appropriate shadow files as well.
I dont think there is such command as it's not necessary in the first place Also it's not advisable to edit that file directly, instead use the appropriate commands like useradd and passwd
If you are not convinced then just reboot after editing that file and all the changes will be effective
You should not modify
/etc/passwd manually; use
If you want to change the user home directory, use this command:
usermod --home /path/to/home/dir username