How Do You Block a Command in Linux?
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...
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.
Must Read
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: