You might be able to use prompt_for_password in fabric.network
def prompt_for_password(prompt=None, no_colon=False, stream=None): """ Prompts for and returns a new password if required; otherwise, returns None. A trailing colon is appended unless ``no_colon`` is True. If the user supplies an empty password, the user will be re-prompted until they enter a non-empty password. ``prompt_for_password`` autogenerates the user prompt based on the current host being connected to. To override this, specify a string value for ``prompt``. ``stream`` is the stream the prompt will be printed to; if not given, defaults to ``sys.stderr``. """ from fabric.state import env handle_prompt_abort("a connection or sudo password") stream = stream or sys.stderr
It looks like it turns out that the structure retrieves the password for ssh, then they set the env value using:
def set_password(password): from fabric.state import env env.password = env.passwords[env.host_string] = password
The key is easily replaced by installing env , but it looks like you might have to check yourself ...
source share