Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Nächste Überarbeitung Beide Seiten, nächste Überarbeitung | |||
admin_grundlagen:pam-ssh-passwoerter-loggen [2021/10/03 11:30] ingo_wichmann angelegt |
admin_grundlagen:pam-ssh-passwoerter-loggen [2021/10/12 15:28] ingo_wichmann |
||
---|---|---|---|
Zeile 9: | Zeile 9: | ||
read password | read password | ||
- | echo "PAM_RHOST: $PAM_RHOST, PAM_RUSER: $PAM_RUSER, PAM_USER: $PAM_USER, password: $password" >> /tmp/passwords | + | echo "PAM_RHOST: $PAM_RHOST, PAM_RUSER: $PAM_RUSER, PAM_USER: $PAM_USER, password: $password" |
- | </file> (( vielleicht besser eine Lösung mit syslog, statt selbst in die Datei zu schreiben )) | + | </file> |
chmod +x /usr/local/sbin/log_password | chmod +x /usr/local/sbin/log_password | ||
Zeile 16: | Zeile 16: | ||
<file txt /etc/pam.d/password-auth> | <file txt /etc/pam.d/password-auth> | ||
auth sufficient pam_unix.so try_first_pass nullok | auth sufficient pam_unix.so try_first_pass nullok | ||
- | auth optional pam_exec.so expose_authtok /usr/local/sbin/log_password | + | auth optional pam_exec.so expose_authtok log=/tmp/passwords /usr/local/sbin/log_password |
</file> | </file> | ||
(( ob ''/etc/pam.d/password-auth'' der ideale Ort dafür, ist fraglich. Und was passiert, wenn authselect o.ä. ausgeführt wird? )) | (( ob ''/etc/pam.d/password-auth'' der ideale Ort dafür, ist fraglich. Und was passiert, wenn authselect o.ä. ausgeführt wird? )) | ||
+ | tail -F /tmp/passwords | ||
+ | warten ;-) | ||