I am not able to recieve password by expose_authtok option of pam_exec module.
HI All,
Please answer the below query.It is very urgent. I want to recieve the passsword given by user at login time,in a variabe to validate it against some rules. I have read about pam_exec.so gives the password to the calling script at stdin by using expose_authtok option. But i am not able to recieve the password in my script.Can anyone help me how can i retrieve the password given by user at login time. |
Well, can we see your script?
|
Here is what my script looked like -
In /etc/pam.d/system-auth i have added a line for calling pam_exec.so library file - session required pam_exec.so expose_authtok /etc/my.sh The /etc/my.sh script contains the following - #!/bin/bash read password echo "$password" > /tmp/a.txt my.sh has 755 permissions and so does a.txt. I know that for recieving password we should use auth instead of session but when i use auth then my script does not get called.That's why i used session. But i have tried with auth too and by using auth also i am not able to get password. Please help me if you know the answer or if u know another alternative to fetch linux original password. |
All times are GMT -5. The time now is 01:46 AM. |