real_command = command
if shell:
    cwd = env.get('cwd', '')
if cwd:
    cwd = 'cd %s && ' % _shell_escape(cwd)
real_command = '%s "%s"' % (env.shell, _shell_escape(cwd + real_command))
if output.debug:
    print('[%s] run: %s' % (env.host_string, real_command))
elif output.running:
    print('[%s] run: %s' % (env.host_string, command))
local("ssh -A %s '%s'" % (env.host_string, real_command))
Запустите ssh-add с помощью Fabric на машине.