Install & Compatibility
Where this runs
tested against v0.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.11
✕ build_error
✓ 1.9s
py 3.12
✕ build_error
✓ 1.65s
py 3.13
✕ build_error
✓ 1.6s
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KAdmin
✓ from kadmin import KAdmin
✗ from kadmin_rs.client import Client
Demonstrates how to initialize a `Client` using a keytab file and list Kerberos principals. Requires proper Kerberos setup and a valid admin principal with a keytab.
import os
from kadmin_rs.client import Client
# IMPORTANT: Replace with your actual Kerberos admin principal and keytab path.
# For testing, you can set these environment variables:
# export KADMIN_ADMIN_PRINCIPAL="admin/admin@EXAMPLE.COM"
# export KADMIN_KEYTAB_PATH="/etc/krb5.keytab"
# Ensure Kerberos is properly configured and the keytab is valid.
admin_principal = os.environ.get("KADMIN_ADMIN_PRINCIPAL", "admin/admin@EXAMPLE.COM")
keytab_path = os.environ.get("KADMIN_KEYTAB_PATH", "/etc/krb5.keytab")
try:
client = Client.with_keytab(
principal=admin_principal,
keytab_path=keytab_path,
)
print(f"Kadmin client connected as {admin_principal}")
# List all principals
all_principals = client.list_principals()
print(f"Found {len(all_principals)} principals.")
if all_principals:
print(f"First principal: {all_principals[0]}")
except Exception as e:
print(f"Error initializing Kadmin client or listing principals: {e}")
print("Please check your Kerberos configuration, admin principal, and keytab path.")
print("Also ensure system Kerberos development libraries are installed (e.g., libkrb5-dev).")
Debug
Known issues
gotchaThe library wraps a Rust implementation, which in turn depends on system-level Kerberos development libraries (e.g., `libkrb5-dev` on Debian/Ubuntu, `krb5-devel` on RHEL/CentOS). Installation will fail or runtime errors will occur without these.fixInstall the appropriate Kerberos development package for your OS before installing `python-kadmin-rs` (e.g., `sudo apt install libkrb5-dev`).
affects: >=0.1.0
breakingThe `add_principal` and `modify_principal` methods had their time-related arguments changed in version 0.6.0. Previously, they accepted `valid_start` and `valid_end` (`datetime` objects). Now, they accept only `valid_until` (a single `datetime` object).fixIf upgrading from a version older than 0.6.0, update calls to `add_principal` and `modify_principal` to use a single `valid_until` `datetime` object instead of `valid_start` and `valid_end`.
affects: >=0.6.0 (breaking for users upgrading from <0.6.0)
gotchaHandling Kerberos credentials (keytabs or credential caches) requires careful security considerations. Ensure keytab files are properly secured with minimal permissions and that credential caches are protected.fixAlways use secure paths for keytabs, restrict file permissions (`chmod 400`), and avoid hardcoding sensitive paths directly in code. Prefer environment variables or secure configuration management systems.
affects: >=0.1.0
gotchaKerberos principal names are strict (e.g., `user/service@REALM.COM`). Incorrect formatting can lead to connection failures or 'Principal does not exist' errors, even if it looks superficially similar to an existing one.fixDouble-check principal names, including realm, and ensure they match the Kerberos KDC configuration exactly. The library does not normalize names; it passes them directly to `kadm5`.
affects: >=0.1.0
Upgrade
Version history
0.7.2latest on PyPI · released May 11, 2026
Audit
Dependencies
libkrb5-dev (Debian/Ubuntu) or krb5-devel (RHEL/CentOS)requiredSystem-level Kerberos development libraries are required for building and running the underlying Rust component that `python-kadmin-rs` wraps.