更新时间:2023-12-05 13:34:16
You can enable SSH agent forwarding for a session in paramiko using AgentRequestHandler. To do this, call paramiko.agent.AgentRequestHandler(s)
with the session s
. For example:
client = paramiko.client.SSHClient()
client.connect(host, port, username)
s = client.get_transport().open_session()
paramiko.agent.AgentRequestHandler(s)
有关更多详细信息和代码,请参见这篇文章.
See this post for more details and code.