ML user Roy Smith reported that he was getting a password prompt when setting reject_unknown_hosts = True, instead of an abort.
Confirmed myself, quickly checked the code and noticed that the host rejection is, sadly, a generic SSHException instance (but with a usefulish message attr) and is caught by the general "did auth fail?" exception check.
Curious whether it ever truly worked, I git bisected; the culprit is fac670a, a commit about fixing password auth that was put in about 10 days after reject_unknown_hosts was implemented. This implies the two features are incompatible as-implemented.
Will check that above commit-diff in detail, but suspect we can route around this by special casing SSHExceptions with the 'unknown server' message.
(Eventually, this should be fixed in the ssh lib itself, so it raises a distinct exception class.)
ML user Roy Smith reported that he was getting a password prompt when setting
reject_unknown_hosts = True, instead of an abort.Confirmed myself, quickly checked the code and noticed that the host rejection is, sadly, a generic
SSHExceptioninstance (but with a usefulish message attr) and is caught by the general "did auth fail?" exception check.Curious whether it ever truly worked, I git bisected; the culprit is fac670a, a commit about fixing password auth that was put in about 10 days after
reject_unknown_hostswas implemented. This implies the two features are incompatible as-implemented.Will check that above commit-diff in detail, but suspect we can route around this by special casing
SSHExceptions with the 'unknown server' message.(Eventually, this should be fixed in the
sshlib itself, so it raises a distinct exception class.)