How to use Pageant with Paramiko on Windows?

I know that Paramiko supports Pageant under Windows, but by default it does not work.

I am looking for an example of connecting using a key loaded in Pageant.

+4
source share
1 answer

This is what I use to connect and automatically log in using Pageant to store my key and connect to it from my Python script. It expects to load Pageant (and I did not find a reliable way to start it and download the key (hint for the key password)), but it works lower now.

ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) host = 'somehost.com' port = 22 ssh.connect(host, port=port, username='user', allow_agent=True) stdin,stdout,stderr = ssh.exec_command("ps -ef") print stdout.read() print stderr.read() 
+6
source

Source: https://habr.com/ru/post/1200731/


All Articles