我怎么可以跳过光纤连接的询问密码? [英] How can I skip Fabric connections that ask for a password?

查看:185
本文介绍了我怎么可以跳过光纤连接的询问密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遍历几百个EC2实例,但只能获得约80%的人。我想跳过那些拒绝我的SSH密钥,并要求输入密码的任何实例。

I'm iterating over a few hundred EC2 instances but only have access to about 80% of them. I would like to skip any instances that have declined my SSH key and asked for a password.

推荐答案

如果主机不可达,那么你可以使用 - 跳坏主机选项,否则 貌似可以使用的设置上下文管理,并尝试在这方面管理的SSH,如果故障发生就可以跳到下一个。该文档的<一个href="http://docs.fabfile.org/en/1.1.0/api/core/context_managers.html#fabric.context_managers.settings"相对=nofollow> context_manager.settings 有一个例子。

If the host is unreachable, then you can use --skip-bad-hosts option, otherwise Looks like you can use the settings context manager and try the ssh within that context manager and if the failure happens it can skip to the next one. The docs for context_manager.settings have an example.

with settings(warn_only=True):
    ssh_attempt # can fail
ssh_attemp # cannot fail

这篇关于我怎么可以跳过光纤连接的询问密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆