0

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
  • For general purpose use, there is no need to deny non-admin users access to Python. Python scripts are not a security hole. If a user lacking admin permission to use sudo calls a Python script that requires admin permission, the script will fail with a permission 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.
    – user535733
    Commented Jun 16, 2023 at 13:03

1 Answer 1

0

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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .