38
13
Both PreferredAuthentications=password
and PreferredAuthentications=keyboard-interactive
would prompt for the password, so what's the difference between them?
I Google'd with the keywords ssh PreferredAuthentications password keyboard-interactive difference but found no answers.
The only difference I noticed is the prompt strings (user@host's password:
vs. Password:
):
$ ssh -o PreferredAuthentications=password,keyboard-interactive my-host
root@my-host's password:
Password:
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).
UPDATE (2018-04-09):
For easy reference, the following is from the SSH:TDG book as mentioned in jouell's answer.
"keyboard-interactive"
user authentication is intended primarily to accomodatePAM
authentication on the server side. It provides for a multiple challenge-response dialog with the user in which the server sends a text query to the user, the user types in a response, and this process can repeat any number of times. So for example, you might configurePAM
for SSH with a module which performs authentication using an RSA security token, or a one-time password scheme. People become confused by this because by default,"keyboard-interactive"
authentication usually just implements password authentication in a single challenge-response cycle, which just prompts for a password, thus looking exactly the same as"password"
authentication. If you're not deliberately using both for different purposes, you may want to disable one or the other to avoid end-user confusion.
1
See RFC 4252 for the password auth and RFC 4256 for keyboard-interactive.
– pynexj – 2017-06-05T10:30:47.570