how to restrict fish shell to only allow certain commands (whitelist-based)?
- User
how to restrict fish shell to only allow certain commands (whitelist-based)?
- Assistant
Fish shell doesn't have a built-in feature to restrict or allow certain commands. However, you can implement something similar using a clever workaround. Here's a basic idea:
-
Create a new user that will be used to run the restricted shell.
-
For that user, set their default shell to be a script you control. This can be done by editing the file or using the command.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.