Всем привет.
Пытаюсь настроить модуль pam_script.so в настройках sshd. Что бы при подключении по ssh, отрабатывался скрипт.
Файл /etc/pam.d/sshd
:
#%PAM-1.0
auth optional pam_script.so debug dir=/bin/myscript.sh
auth required pam_sepermit.so
auth substack password-auth
auth include postlogin
# Used with polkit to reauthorize users in remote sessions
-auth optional pam_reauthorize.so prepare
account required pam_nologin.so
account include password-auth
password include password-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open env_params
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include password-auth
session include postlogin
# Used with polkit to reauthorize users in remote sessions
-session optional pam_reauthorize.so prepare
~
Кусок лога:
Mar 18 13:39:19 admin-rsatest sshd[8876]: pam_unix(sshd:session): session closed for user user1
Mar 18 13:39:25 admin-rsatest sshd[8939]: Accepted password for anatoliit from 172.30.253.197 port 50763 ssh2
Mar 18 13:39:26 admin-rsatest sshd[8939]: pam_unix(sshd:session): session opened for user user1 by (uid=0)
Но при подключении, модуль не отрабатывает. Просьба подсказать, почему. Заранее спасибо.