Skip to content

reject_unknown_hosts triggers password prompt #671

Description

@bitprophet

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions