I have these settings on my remote machine under /etc/ssh/sshd_config
PermitRootLogin no
PermitRootLogin prohibit-password
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
The reason I did that is because I previously only wanted to be able to remotely connect via ssh with my public key installed.
But then I was curious about trying cockpit, installed it, and logged in successfully. But why did it work?
This stack answer directed me here stating that cockpit runs as a PAM module. But if I disabled PAM, why does it let me still log in via the web interface?