Skip to main content

OTPme: A flexible One-Time-Password system

Project description

Installation instructions

Warning: OTPme is alpha software. Do not use it in production. Expect breaking changes, incomplete features and bugs.

Full documentation is available at https://otpme.readthedocs.io.

Manpages can be installed with:

otpme-install-manpages

Install debian dependencies

apt-get install python3.11-venv gobjc++ python3-pybind11 python3-dev build-essential cmake gcc dbus-x11 freeradius freeradius-python3 libacl1-dev libnss-cache liboath0 liboath-dev libpcsclite1 libpq-dev libre2-9 libre2-dev libsystemd-dev pkg-config postgresql postgresql-server-dev-all pwgen pyflakes3 redis redis-server redis-tools libpcsclite-dev ykcs11 fuse3 libpam-python

Disable installed services

systemctl stop redis
systemctl disable redis
systemctl stop postgresql
systemctl disable postgresql
systemctl stop freeradius
systemctl disable freeradius

Install otpme

Add otpme system user

useradd -r -U -d /var/lib/otpme otpme

Enable nsswitch nsscache module

Edit /etc/nsswitch.conf and append 'cache' to the lines passwd, shadow and group.

Create python venv

python3 -m venv /opt/otpme
. /opt/otpme/bin/activate

Install otpme and dependencies

pip3 install cython
pip3 install otpme

OTPme ships with optional pip extras for the per-role server install variants. Pick the one matching the role of this machine:

Command Role
pip3 install otpme host — client + otpme-agent + PAM + nsscache + offline_token + local-backup client. Default.
pip3 install 'otpme[backuphost]' backuphost — host + the backup daemon (backupd). Pulls rbloom for dedup.
pip3 install 'otpme[ssohost]' ssohost — host + the SSO web portal (ssod+httpd). Pulls Flask, gunicorn, joserfc.
pip3 install 'otpme[node]' node — full server install. Implies [backuphost] and [ssohost] and additionally pulls Twisted/ldaptor (LDAPd), pyrad (FreeRADIUS plugin), arprequest/scapy (cluster ARP), service_identity.
pip3 install 'otpme[node,dev]' full server + dev tools (pytest, coverage, ruff).

The role-aware extras correspond to the SSO_SERVER and BACKUP_SERVER flags in /etc/otpme/otpme.conf (and to the full-node role). Installing without extras keeps the dependency footprint minimal for plain host machines.

Copy configuration files

cp -a /opt/otpme/lib/python3.11/site-packages/etc/otpme /etc/
cp -a /etc/otpme/otpme.conf.dist /etc/otpme/otpme.conf

Edit /etc/otpme/otpme.conf

POSTGRES_PG_CTL_BIN="/usr/lib/postgresql/15/bin/pg_ctl"

Create PYTHONPATH file with path to venv (e.g. /opt/otpme/lib/python3.11/site-packages/)

/etc/otpme/PYTHONPATH

Init your otpme realm

otpme-realm --api -ddee --color-logs -f init --ca-key-len 2048 --site-key-len 2048 --node-key-len 2048 --dicts english,en-top10000,common-passwords,us-female,us-male,us-surnames,abbreviations-it --id-ranges "uidNumber:s:100000-200000,gidNumber:s:100000-200000" yourrealm.tld yoursite localhost 127.0.0.1

Note: Scan the generated QRCode with the "Google Autenticator App" and note the PIN of the admin token.

Start OTPme daemons

otpme-controld start

Login with admin token

You need to input pin+otp.
otpme-tool login

Add optional U2F/fido2 attestation certificates from https://developers.yubico.com/FIDO/yubico-fido-ca-certs.txt.

wget https://developers.yubico.com/FIDO/yubico-fido-ca-1.pem
wget https://developers.yubico.com/FIDO/yubico-fido-ca-2.pem
otpme-site add_fido2_ca_cert yoursite yubico-fido-ca-1.pem
otpme-site add_fido2_ca_cert yoursite yubico-fido-ca-2.pem
otpme-site config yoursite check_fido2_attestation_cert True

Disable gpg-agent (systemd) to use yubikey/GPG card with the PAM module.

systemctl --global mask --now gpg-agent.service gpg-agent.socket gpg-agent-ssh.socket gpg-agent-extra.socket gpg-agent-browser.socket

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otpme-0.3.0a210.tar.gz (6.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otpme-0.3.0a210-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

Details for the file otpme-0.3.0a210.tar.gz.

File metadata

  • Download URL: otpme-0.3.0a210.tar.gz
  • Upload date:
  • Size: 6.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for otpme-0.3.0a210.tar.gz
Algorithm Hash digest
SHA256 58182ee9951e63b48e687a79d4141cd20315fa61f8d6d3e2fc33dd012c1f2d55
MD5 c76b2a4e454e8c0300e7f63b55b2f557
BLAKE2b-256 a9712163a0fe630968baf1491fb541ca78f497af6368b23bea2ea3091650c0ca

See more details on using hashes here.

File details

Details for the file otpme-0.3.0a210-py3-none-any.whl.

File metadata

  • Download URL: otpme-0.3.0a210-py3-none-any.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for otpme-0.3.0a210-py3-none-any.whl
Algorithm Hash digest
SHA256 1c979a7d345ae2d0f7c566df0436fe2964e8c0abb5eb90b009424bc31374d7b0
MD5 fbf2f4a9d8ce5215df29b9346296c035
BLAKE2b-256 26eaab0b9bbc3383ed7eb9287645eae31b9f467b2c0c9957d1dd9232f47f4cb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page