How can I prevent users from changing their passwords? I still want to be able to change the passwords as root if necessary but keep the user from changing their password.
passwd -n 9999 user will prevent
user from changing his password for almost 274 years.
If you want to have passwordless
user, which is unable to change his password, open
/etc/shadow as root, find the line which begins with the name of the user, and change the content between first and second colon to