Here is what I try to accomplish:
I have a server with a git repository.
I use ISPConfig as control panel for our websites and I want to integrate the ISPConfig API for email authentication as second authentication.
Here is the authentication flow:
- The user connects with ssh-rsa key (without password)
- The ssh has to run a script which prompts the user for second authentication with email and password. These credentials are verified with the API and if correct the user is logged in through SSH, otherwise the user is disconnected.
I've installed the libpam_script (
apt-get install libpam_script) and tried to configure it, but with no luck.
I've tried several things by adding this line
auth required pam_script.so to:
None of them executed the script
In both scripts I have this code:
#!/bin/bash echo "Logging" > /home/server/pam.log
The code is just for testing to see if it's even executed.