I'd like to modify sshd_config file to run one script if user ssh in with password and another script if user ssh into server using SSH Signed certificate. I see, This might be possible with the combination of Match and ForceCommand but I'm having hard time to understand how to identify if user used PasswordAuthentication to get in or SSH Cert to get into the server.
For ex something like below:
Match (If User used password) ForceCommand /usr/sbin/passwordscript
Match (If User used pubkey) ForceCommand /usr/sbin/pubkeyscript
Match (If User used TrustedUserCAKeys(?)) ForceCommand /usr/sbin/sshcertdscript
Is there any way I can find how user is trying do ssh into server whether its a password, public key or TrustedUserCAKeys(SSH Cert)?
Thanks in Advance..