当我尝试使用fabric时,它在我进行身份验证后为我提供了一个远程shell。然后当我退出时,结构任务运行。这是为什么?
这是我收到的输出:
user@locahost:~$ fab -H remote_host mytask
[remote_host] Executing task 'mytask'
[remote_host] run: python --version
[remote_host] Login password:
[remote_host] out: user@remote_host:~>exit
[remote_host] out: exit
[remote_host] out: Could not open a connection to your authentication agent.
[remote_host] out: Python 2.6.4
[remote_host] out:
Done.
Disconnecting from remote_host... done.
我登录后,收到以下提示user@remote_host:~>
,我必须手动退出。
fabfile.py的内容:
from fabric.api import run
def mytask():
run("python --version")
顺便说一句,我正在使用Fabric 1.2版。
答案 0 :(得分:1)
Could not open a connection to your authentication agent.
告诉我它正在寻找ssh-agent或者其他一些东西。查看您正在连接的主机的.login / .profile / .bash_profile以查找问题。另外,尝试手动启动SSH连接,看看是否提供了任何提示。