pam_mount to automatically mount SMB/CIFS shares on login of a user and this works so far, but when someone authenticates without a password (via ssh-key) the mount fails because there is no password to pass to the mount programm. This will lead to a
Permission denied error and will count as a failed authentication attempt. The problem is that user accounts are locked after several failed authentication attempts. Therefore if you use a ssh-key you will lock yourself out after some time.
Is there a way to tell PAM to not try to mount something if there is no password provided?
I found on their mailing list that an option
soft_try_pass should do the trick (https://sourceforge.net/p/pam-mount/mailman/message/19574581/) but this option is not available anymore.
This is on Ubuntu 18.04 with