How do I make sure that a non-administrator user can not change his own password? I want only administrator to do that.
You can remove the SETUID bit from
sudo chmod u-s /usr/bin/passwd
although this is not recommended.
/usr/bin/passwd binary is a SETUID executable with owner as
root, so when
passwd is executed by anyone it is run as
root (so necessary changes in
/etc/shadow files can be done). By removing the SETUID bit, we have removed this capability.