1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Fabricでの接続時にssh_configを参照させる

Posted at

Fabric では ssh の接続に Paramiko をつかう。
というわけで、ssh_config に ProxyCommand を指定してあったとしてもそのままでは読んでくれない。

参照させるには、頭のほうに

from fabric.state import env
env.use_ssh_config = True 

を入れる。

IdentityFile、ForwardAgent についても設定できる。

デフォルトでは

env.key_filename = None
env.forward_agent = False

マニュアルには

dentityFileenv.key_filename を(置き換えるのではなく)拡張します。

とあるので、

if not env.key_filename:
    env.key_filename = []
env.key_filename.append('/path/to/file')

のようにするのが正しいのだろうか。

詳細は [実行モデル — Fabric ドキュメント> ネイティブのSSH configファイルの活用]
(http://fabric-ja.readthedocs.org/ja/latest/usage/execution.html#leveraging-native-ssh-config-files) を参照する。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?