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.
EDIT:
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:
/etc/pam.d/sshd
/etc/pam.d/login
/etc/pam.d/common-auth
None of them executed the script /etc/security/onauth
nor /usr/share/libpam-script/pam_script_auth
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.
pam_script
doesn't work even when logging in on console (throughlogin
)? – peterph Jan 14 '14 at 13:45