Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python-PAM module for salted-hash authentication from a database (MySQL, PostgreSQL, Redis)
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README
pam_dbauth.py

README

Filename: pam_dbauth.py
Description: Performs salted-hash authentication from a database
Author: Eric Windisch <eric@windisch.us>
Copyright: 2010, Eric Windisch <eric@grokthis.net>, VPS Village
License: EPL v1.0

What does it do?
------------------------------------------------------------------
Supports salted-hash authentication via PostgreSQL, MySQL, and
Redis! SQLite3 and other databases may be easily added...

Installation & Usage:
------------------------------------------------------------------
Add to PAM configuration with:
auth required pam_python.so pam_dbauth.py


Requires configuration file, /etc/security/pam_dbauth.conf,
Example:

  [database]
  host=localhost
  user=myuser
  password=mypass
  db=myuser_db
  port=XXXX
  engine=mysqldb
  ; engine=psycopg2
  ; engine=redis

  [query]
  ; SQL Example
  select_statement=select password from users where username=%s

  ; Redis example:
  ; select_statement=users:%s:password

  ; ---------------------------------------------------------------- 
  ;  Support forcing or defaulting hashtypes,
  ;  ONLY effective if stored password does not start with {hashtype}.
  ; ---------------------------------------------------------------- 
  ; hashtype_force=sha1
  ;
  ; ----------------------------------------------------------------
  ;  Default type to be used if all auto-detection fails (unlikely)
  ; ----------------------------------------------------------------
  ; hashtype_default=md5

Something went wrong with that request. Please try again.