<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">Hi all,<br><br> For a small project I am collaborating on, I need to disable any possible password-based authentication in PAM, for SSH, so that the only authentication happens through a script called via pam_exec. This is how the sshd pam module looks, after having commented out the "auth substack password-auth" entry<br><br> #%PAM-1.0<br> auth required pam_sepermit.so<br> auth sufficient pam_exec.so stdout /bin/script_auth.sh<br> #auth substack password-auth<br> auth include postlogin<br> # Used with polkit to reauthorize users in remote sessions<br> -auth optional pam_reauthorize.so prepare<br> account required pam_nologin.so<br> account include password-auth<br> password include password-auth<br> # pam_selinux.so close should be the first session rule<br> session required pam_selinux.so close<br> session required pam_loginuid.so<br> # pam_selinux.so open should only be followed by sessions to be executed in the user context<br> session required pam_selinux.so open env_params<br> session required pam_namespace.so<br> session optional pam_keyinit.so force revoke<br> session include password-auth<br> session include postlogin<br> # Used with polkit to reauthorize users in remote sessions<br> -session optional pam_reauthorize.so prepare<br><br>The contents of password-auth are the defaults:<br><br> #%PAM-1.0<br> # This file is auto-generated.<br> # User changes will be destroyed the next time authconfig is run.<br> auth required pam_env.so<br> auth sufficient pam_unix.so nullok try_first_pass<br> auth requisite pam_succeed_if.so uid >= 1000 quiet_success<br> auth required pam_deny.so<br><br> account required pam_unix.so<br> account sufficient pam_localuser.so<br> account sufficient pam_succeed_if.so uid < 1000 quiet<br> account required pam_permit.so<br><br> password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=<br> password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok<br> password required pam_deny.so<br><br> session optional pam_keyinit.so revoke<br> session required pam_limits.so<br> -session optional pam_systemd.so<br> session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid<br> session required pam_unix.so<br><br>So my question is: does anybody know why am I getting a "Broken pipe" error when logging in with this module, and I can see on the server journal a pam_setcred error? How can I achieve my goal?<br><br>Thank you very much for your time,<br>Felix</div></body></html>