python-sudo
Modular Python to execute any subprocess commands as another user (not necessarily superuser/root)
calling sudo -u
Usage:
This module does not take a user password for security and efficiency reasons (aiming for no user interaction to run).
Configure the sudoers file to allow running commands as another user (not necessarily the superuser):
sudo visudo:
parent_user ALL=(run_user) NOPASSWD: ALL
from sudo import run_as_sudo
# run `whoami` from user 'user'
cmd = "whoami"
sudo_user = "user"
run_as_sudo(sudo_user, cmd)
# optional shell, timeout (secs)
run_as_sudo(sudo_user, cmd, shell=True, timeout=20)
Metadata
Release files for sudo 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sudo-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sudo-1.0.0-py3-none-any.whl |
Release files / sudo-1.0.0-py3-none-any.whl
| Download URL | sudo-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65ace059d4173d2d7ffb0f0697ee64faeaef833ae2a1328b3124a39aea00a19c
|
|
BLAKE2b-256 checksum How to use checksums |
bb67d6f3d7cca5de7525bd75e1743fbc278bf3f995015c4c16848f2084da4b6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for sudo 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.