New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reject_unknown_hosts triggers password prompt #671
Comments
|
Thanks for the quick fix! I tested this out. It does indeed cause a failure on a missing host key, but in the form of an uncaught exception. It would be cleaner if it caught the NetworkError and just printed a failure message. |
|
It should be doing so, and was for me when I tested with |
|
The problem seems to be related to parallel operation. If I run the following script with "fab --fabfile=try.py preflight", I get the stack dump. If I comment out the @parallel, it works (i.e. fails with the message "Fatal error: Unknown server app1.songza.com" and no stack). from fabric.api import run, task, env env.reject_unknown_hosts = True env.roledefs = { @task run("hostname") |
|
I am on an RFC1918 network, and within my network, I can ssh without password, using keys. I also can ssh by hand to remote servers using keys, but when I set 'env.reject_unknown_hosts = True', I get asked for a password for the same remote server, but not the local machines. I tried this with both 1.7.0 (system package) and a 1.8.1 from a virtualenv, both using Python 2.7.3 on Debian Wheezy/amd64. |
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.)The text was updated successfully, but these errors were encountered: