Official python pam documentation:
- Generate a key-pair by going to your Interlock installation directory and executing the following commands:
. venv/bin/activate
python3 manage.py generate_pam_key- Keep the
SEND_ENCRYPTEDandRECV_EXPECTEDvalues handy, you'll need them.
- Clone this repository to a location of your choice (you may need to install
git). - Copy the
./srcfolder to/usr/share/interlock-plugin-pam. - Give it the following permissions:
chmod -R 750 /usr/share/interlock-plugin-pam/chown root:root /usr/share/interlock-plugin-pam/
- Add the following line to
/etc/pam.d/interlock-auth:auth sufficient pam_python.so /usr/share/interlock-plugin-pam/pam_rest_auth.py
- Add the following line to
/etc/pam.d/common-auth:@include interlock-auth
- Install the following dependencies:
apt install python3 python3-pam python3-requests python3-pampy libpam-python pamtester - Edit your
/usr/share/interlock-plugin-pam/config.iniconfig file:- Add your API URL as "API_URL=".
- Add the
SEND_ENCRYPTEDandRECV_EXPECTEDvalues from before.
- Add user shell definitions to
/usr/share/interlock-plugin-pam/user_shells.ini(see sample file). - Test authentication with
pamtester login $username authenticate.