How to ForwardAgent yes using fabric?

Almad picture Almad · Oct 11, 2011 · Viewed 8k times · Source

I am successfully run()ning commands on remote server with my private key pair.

However, I'd like to do git clone ssh://private/repo on remote server using my local key (or using local ssh agent I'm in).

How to do it using fabric?

Answer

anatoly techtonik picture anatoly techtonik · Apr 18, 2012

Since version 1.4 fabric has environment option that enables agent forwarding.

env.forward_agent = True

UPD: This feature was buggy before fabric 1.4.2