im seeking for some scripts that deny access to the app python in my PC. example: a new user with low privileges can call python without type sudo or su, i wanna prevent this kind of situation by the same way that hosted users could start python without restrictions.
1 Answer
You are most likely looking for a restricted shell - the setup of which has been described in depth within this answer. This allows only executables that can be found on the PATH (where you could exclude the python
binary from for that specific user).
sudo
calls a Python script that requires admin permission, the script will fail with apermission denied
error. If you discover a way for non-admin users to abuse Python to gain admin access, please file a bug report and subscribe the Ubuntu Security Team to that bug.