Contents
How do I block a command in Linux?
However if you only want to allow the user to run several commands, here is a better solution:
- Change the user shell to restricted bash chsh -s /bin/rbash <username>
- Create a bin directory under the user home directory sudo mkdir /home/<username>/bin sudo chmod 755 /home/<username>/bin.
How do I block a specific user in Linux?
How to disable a specific command for a specific user in Linux
- Find the absolute path to the command to be controlled: # which mkdir /bin/mkdir.
- Display the current ACL for that program: …
- Add an access control rule for the user john: …
- View the updated access control: …
- Test the setting: