Hi all,
I downloaded source from https://sourceforge.net/u/anders_blomdell/pam-python/ci/py3/tree/
and build it using make and make install on CentOS8.1.
I defined a pam_sm_authenticate() function in seperate python file and try to called it inside /etc/pam.d/sshd file :
auth required /lib/security/pam-python3.so /home/test.py use_first_pass
But in /var/log/secure i am getting the following error
Aug 20 15:26:17 localhost /home/test.py[7911]: Can not open module: Permission denied
and my test.py is just a simple file as follows-
def pam_sm_authenticate(pamh, flags, argv):
print("hello")
return pamh.PAM_SUCCESS
def pam_sm_setcred(pamh, flags, argv):
return pamh.PAM_SUCCESS
def pam_sm_acct_mgmt(pamh, flags, argv):
return pamh.PAM_SUCCESS
def pam_sm_open_session(pamh, flags, argv):
return pamh.PAM_SUCCESS
def pam_sm_close_session(pamh, flags, argv):
return pamh.PAM_SUCCESS
def pam_sm_chauthtok(pamh, flags, argv):
return pamh.PAM_SUCCESS
Please suggest how to resolve this. Any lead will be appreciated.