检查ssh-agent是否加载,我把条件
""" Check if ssh-agent is working and are forwarding keys to mgmt host #ssh-add -L """
agent = paramiko.Agent()
agent_keys = agent.get_keys()
if agent_keys:
pass
else:
print " ssh-agent is not working for your id , please fix the same and run ssh-add -L to check if your public key is getting forwarded by ssh-agent "
它运行正常,但是用sudo运行它不起作用,我想知道如何获取用户的ssh-agent,即使它是由sudo运行的。