Playing with the ssh application and public_key in Erlang, I found a nice function .
I tried to connect to my running Erlang SSH daemon using the rsa key , but authentication was unsuccessful and I was asked to enter a password.
After some debugging and tracing (and a couple of coffees), I realized that for some strange reason, the key for my user was invalid. The authorized_keys file contains two keys . The wrong one was at some point in the file, while the correct one was added at the end of the file.
Now, the Erlang SSH application, when delimiting the provided key with the keys contained in authorized_keys, found the first record (completely ignoring the second - the correct one). Then he switched to another authentication mechanism (first he tried dsa instead of rsa, and then asked for a password).
Question: Is this behavior expected or should the SSH server check for multiple entries for the same user in the authorized_keys file? Is this common SSH behavior or just specific to Erlang implementation?
source
share