I want to set the authentication order when a user wants to log in.
Match User user
PasswordAuthentication no
MaxAuthTries 5
AuthenticationOrder "publickey,password"
Match all
PasswordAuthentication yes
AuthenticationMethods "publickey,password" "publickey,keyboard-interactive"
I want to set for user, if he doesn't have publickey, then use the password. If he has publickey then logs in.
All user needs to have a publickey and a password to log in.