- class fabric.auth.OpenSSHAuthStrategy(ssh_config, fabric_config, username)¶
Auth strategy that tries very hard to act like the OpenSSH client.
As of version 3.1, this class is EXPERIMENTAL and incomplete. It works best with passphraseless (eg ssh-agent) private key auth for now and will grow more features in future releases.
For example, it accepts a
SSHConfigand uses any relevant
IdentityFiledirectives from that object, along with keys from your home directory and any local SSH agent. Keys specified at runtime are tried last, just as with
ssh -i /path/to/key(this is one departure from the legacy/off-spec auth behavior observed in older Paramiko and Fabric versions).
New in version 3.1.
- __init__(ssh_config, fabric_config, username)¶
Extends superclass with additional inputs.
fabric.Configinstance for the current session.
username, which is unified by our intended caller so we don’t have to - it’s a synthesis of CLI, runtime, invoke/fabric-configuration, and ssh_config configuration.
Also handles connecting to an SSH agent, if possible, for easier lifecycle tracking.
Shut down any resources we ourselves opened up.