--- id: python-pam version: "2.0.2" license: License :: OSI Approved :: MIT License license_treatment: permissive maintenance: active --- # python-pam — Python PAM module using ctypes, py3 License: permissive · Maintenance: active · Downloads: 2.3M/mo ## What it is and what it does python-pam is a ctypes-based wrapper around the Linux PAM (Pluggable Authentication Modules) library, allowing Python code to authenticate users against system credentials. It exposes PAM's authentication flow through a simple API: create an authenticator object, call authenticate() with a username and password, and receive a boolean result plus error codes and reason strings. The package is designed for system administration and security-focused applications that need to verify user credentials against the system's authentication stack (typically /etc/shadow via pam_unix.so). It has no external runtime dependencies and runs on any Linux/POSIX system with PAM installed. Authentication is subject to privilege constraints: unprivileged code can only verify the current user's credentials, while privileged (root) code can verify any user. Use it for: - Authenticate users in a Python web application or service against system accounts without reimplementing password verification - Build system administration tools that need to verify user credentials as part of access control logic - Integrate PAM authentication into Python-based login or privilege-escalation workflows - Verify user identity in containerized or virtualized environments where system PAM is available - Test PAM service configurations programmatically by authenticating against different PAM services ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python wrapper for Linux PAM (Pluggable Authentication Modules) that authenticates users against system credentials using ctypes bindings. Yes, if you need to authenticate against Linux system credentials and are comfortable with the privilege model and platform constraints. The package is mature, permissively licensed, has no dependencies, and carries no known vulnerabilities. The 1610-day gap since last release is notable but not disqualifying given the stable nature of PAM itself; verify that ctypes bindings remain compatible with your target systems before deploying. ## Install pip install python-pam uv add python-pam poetry add python-pam ## Installing python-pam Before you install: Low install friction with no runtime dependencies. Marked as mature and actively maintained with recent commits, though last release was in 2022. License in practice: MIT license (permissive) — you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions. Quickstart: pip install python-pam import pam p = pam.authenticate() result = p.authenticate('username', 'password') print(result) # True if successful, False otherwise Linux/POSIX system only (not Windows). Requires PAM libraries installed on the system. Privilege constraints apply: without root, you can only authenticate the current user; with root, you can authenticate any user. Verify before relying: - Whether the package works with modern Python versions beyond 3.9 (classifiers list Python 2 and 3 generically) - Current state of ctypes bindings compatibility with recent glibc/PAM versions - Whether the 1610-day gap since last release indicates maintenance concerns or stable maturity ## Package facts - License: License :: OSI Approved :: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 2.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags linux pam authentication, system user authentication python, pam credentials verify, linux password validation, pluggable authentication modules python, unix user authentication, pam service authentication, linux-pam, system-auth, ctypes-binding [View on SkillFed](https://skillfed.io/packages/python-pam) · [View on PyPI](https://pypi.org/project/python-pam/)