Call a shell command from Python (was: Calling Bash Command From Python)
Chris Angelico
rosuav at gmail.com
Mon Oct 31 00:55:21 EDT 2016
More information about the Python-list mailing list
Mon Oct 31 00:55:21 EDT 2016
- Previous message (by thread): Call a shell command from Python (was: Calling Bash Command From Python)
- Next message (by thread): Call a shell command from Python (was: Calling Bash Command From Python)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Oct 31, 2016 at 3:44 PM, Ben Finney <ben+python at benfinney.id.au> wrote: > Note that ‘sudo’ is specifically designed to be invoked interactively, > seeking to verify that the current user has credentials to run the > command. > > Note further that ‘sudo’ will record when the *current user session* > last invoked ‘sudo’ and seek re-verification if that is too long in the > past. > > Both of these are security measures, and are designed to avoid > non-interactive use of ‘sudo’. Rather, it's meant to be used > interactively by a real, present human with credentials to run the > command. I don't know that non-interactive sudo is so bad a thing. In fact, sudo has a --non-interactive option that appears specifically designed for this kind of thing - it causes the command to fail rather than prompt. You can configure a sudoers file to allow passwordless execution of specific commands, and then permit scripts to elevate privileges in very limited ways, safely. ChrisA
- Previous message (by thread): Call a shell command from Python (was: Calling Bash Command From Python)
- Next message (by thread): Call a shell command from Python (was: Calling Bash Command From Python)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list