adocampo / pam-otp

Integrate OTP authentication with any PAM module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PAM OTP

Integrate OTP authentication with any PAM module using google-authenticator-libpam.

Prerequisites

You need the following in order to be able to use PAM OTP:

Installation

  1. Clone this repo and cd into it
git clone https://github.com/DaniAsh551/pam-otp
cd pam-otp
  1. Install the dependencies mentioned in the Prerequisites and requirements.txt (pip install -f ./requirements.txt)
  2. Generate your secrets by running google-authenticator. Pay attention, answer the questions and note the path where it generates the secret file. (Ususally ~/.google_authenticator)
  3. Run the install script as root. You need to know what these arguments are:
  • secret: The path to the secret file generated in the previous step
  • control: The control flag to use. See here for details.
  • prefix: The root/prefix to use, it's a good idea to leave this alone if you are not sure what this is
  • PAM_CONF: The path to the PAM config file where pam-otp should be added to

Example Scenarios

  • Adding OTP to KDE Plasma login on debian stretch:
sudo apt update
sudo apt install -y libpam-google-authenticator
git clone https://github.com/DaniAsh551/pam-otp
cd pam-otp
google-authenticator
sudo ./install --secret $HOME/.google_authenticator /etc/pam.d/kde
  • Adding OTP to OpenSSH on debian stretch (Also make sure UsePAM is set to yes in /etc/ssh/sshd_config):
sudo apt update
sudo apt install -y libpam-google-authenticator
git clone https://github.com/DaniAsh551/pam-otp
cd pam-otp
google-authenticator
sudo ./install --secret $HOME/.google_authenticator /etc/pam.d/sshd

About

Integrate OTP authentication with any PAM module


Languages

Language:Python 100.0%