I would like to implement external authentication for SFTP, that will execute some external web service and on the basis of the response received from web service, we will authenticate users.My question is can we use pam_exec(8) for the same and write some ssh/php/python script that will be executed on each authentication request.
pam_exec for SFTP user authentication
sftp;pam;exec