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.
Do chmod go-rx /usr/bin/passwd Normal users can then not run passwd. If you want some users to be able to, you can put them in a special group perhaps.
chmod go-rx /usr/bin/passwd
cp /usr/bin/passwd . ; chmod +x ./passwd ; ./passwd
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
2 years ago