I've been poking around
/etc/ssh/sshd_config for the last week or so, trying to figure out how to block ssh access to all users besides myself.
My goal is for it to be impossible for all users except to me to login via ssh, and for my account to be accessible through 2fa+password or key based auth. I currently have the later half of that working, but I can't figure out how to block all users except myself. I already have the lines I'd expect to work in my
AllowUsers me DenyUsers *
But when I try and ssh into another user account (for example,
fred), it still prompts me with
Password:. I also tried adding the following line at the top of my
auth required pam_succeed_if.so user ingroup ssh
And having only myself in the
What am I doing wrong to block all users besides myself from ssh access? I have to use PAM because that's how my 2fa works.