Hi I'm trying to disable password login for all users except one, "foo". That way, for example, I can login as "bar" with public key but not password. And I can login as "foo" with password.
I tried this config:
However, I still can login as "bar" with password!!!
Then, I tried this config:
Unfortunately, ChallengeResponseAuthentication cannot be inside a Match block
If I move ChallengeResponseAuthentication no outside:
Then ssh disabled password login for EVERYBODY, including "foo".
So, my dilemma is - I want to disable password login for everyone except user "foo". How can I do this?
I tried this config:
Code:
AllowUsers foo bar
Match User !foo
PasswordAuthentication no
Match all
# restart sshd afterwards
However, I still can login as "bar" with password!!!
Then, I tried this config:
Code:
AllowUsers foo bar
Match User !foo
PasswordAuthentication no
ChallengeResponseAuthentication no
Match all
Unfortunately, ChallengeResponseAuthentication cannot be inside a Match block
If I move ChallengeResponseAuthentication no outside:
Code:
ChallengeResponseAuthentication no
AllowUsers foo bar
Match User !foo
PasswordAuthentication no
Match all
Then ssh disabled password login for EVERYBODY, including "foo".
So, my dilemma is - I want to disable password login for everyone except user "foo". How can I do this?