python-pam
Python PAM module using ctypes, py3
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) — you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.
last release 2022-03-18 (1610 days) · last repo commit 2026-08-10 · 119 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,335,539 downloads/mo, #3,128 on PyPI
Alternatives
Verify before relying
pip install python-pam
import pam
p = pam.authenticate()
result = p.authenticate('username', 'password')
print(result) # True if successful, False otherwise- 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
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 on this page. Verify before relying on it.
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
python-pam on PyPI
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.
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.
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
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 | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 1,610 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,335,539 / month, #3,128 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureEnvironment :: PluginsIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: SecurityTopic :: System :: Systems Administration :: Authentication/Directory |
Evidence: python_pam-2.0.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “linux pam authentication”
- python-pamPython wrapper for Linux PAM (Pluggable Authentication Modules) that…
- pamelaPamela provides a Python interface to the Linux/Unix PAM (Pluggable…
- keepercommanderKeeper Commander is a command-line and terminal UI tool for managing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Security packages
Provides Python bindings to the FreeDesktop.org Secret Service API for securely storing and retrieving passwords and secrets through GNOME Keyring, KWallet, or KeePassXC.
MSAL for Python handles OAuth2 and OpenID Connect authentication with Microsoft identity services, managing token acquisition, caching, and refresh for applications integrating with Microsoft Entra ID, Microsoft Accounts, and Azure AD B2C.
joserfc implements JOSE standards (JWS, JWE, JWK, JWT, and related RFCs) for signing, encrypting, and managing JSON-based cryptographic tokens in Python.
Authlib provides a complete implementation of OAuth 1.0, OAuth 2.0, and OpenID Connect 1.0 for building both authentication clients and servers, with built-in support for JWS, JWK, JWA, and JWT standards.
Provides low-level CFFI bindings to the official Argon2 password hashing algorithm for use by libraries and applications that need direct access to Argon2 without higher-level abstractions.
ADAL for Python authenticates applications with Azure Active Directory to obtain tokens for accessing Azure AD-protected resources.
Install only if maintaining existing code that already depends on it, and plan a migration.
See also pamela · httpx-ntlm · docker-pycreds · pyseccomp · pure-python-adb · google-cloud-privilegedaccessmanager · siwe · wsgidav · pyspnego · requests-ntlm2