diff options
author | Lew Gordon <lew.gordon@genesys.com> | 2021-03-29 13:20:32 -0400 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2022-03-11 11:38:18 -0500 |
commit | 3bb7877c13c22ec184ec77e4c4396539ae9f90b4 (patch) | |
tree | 95c2532a4b0e5816e9fa3ac790ab5d8d0201768a /paramiko/agent.py | |
parent | 6e2dcda476ef6b0a360a7b8e01088b1cbef94fcf (diff) | |
download | paramiko-3bb7877c13c22ec184ec77e4c4396539ae9f90b4.tar.gz |
support Windows OpenSSH agent besides Putty's pageant (addresses #1509)
Since quite a while there exists a native openssh port for windows.
If the Putty pageant is not present, try to use the native port's agent
instead.
Diffstat (limited to 'paramiko/agent.py')
-rw-r--r-- | paramiko/agent.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py index f28bf128..fc3b66fb 100644 --- a/paramiko/agent.py +++ b/paramiko/agent.py @@ -246,7 +246,12 @@ class AgentClientProxy(object): if win_pageant.can_talk_to_agent(): conn = win_pageant.PageantConnection() else: - return + import paramiko.win_openssh as win_openssh + + if win_openssh.can_talk_to_agent(): + conn = win_openssh.OpenSSHAgentConnection() + else: + return else: # no agent support return @@ -366,6 +371,10 @@ class Agent(AgentSSH): :raises: `.SSHException` -- if an SSH agent is found, but speaks an incompatible protocol + + .. versionchanged:: 2.10 + Added support for native openssh agent on windows (extending previous + putty pageant support) """ def __init__(self): @@ -384,7 +393,12 @@ class Agent(AgentSSH): if win_pageant.can_talk_to_agent(): conn = win_pageant.PageantConnection() else: - return + import paramiko.win_openssh as win_openssh + + if win_openssh.can_talk_to_agent(): + conn = win_openssh.OpenSSHAgentConnection() + else: + return else: # no agent support return |