Menu

#10 Module not able to open *.py file . Permission denied error

1.0
open
nobody
None
2020-08-21
2020-08-21
Rahul
No

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.

Discussion


Log in to post a comment.