Monday, April 29, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2430  / 2 Years ago, thu, april 14, 2022, 9:58:01

How can I prevent a none root user to executes e.g. the passwd command in terminal?


More From » command-line

 Answers
6

To avoid a user from running the passwd command, just make it non-executable for everyone but root.



sudo chmod o-x /usr/bin/passwd


An odd request though. You usually want users to be able to change their password, and to do it regularly. Also, the passwd command isn't the only way a user can change their own password...


[#40142] Friday, April 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
entmpy

Total Points: 52
Total Questions: 112
Total Answers: 113

Location: Marshall Islands
Member since Tue, Sep 21, 2021
3 Years ago
;