How to ssh connect through Python Paramiko with ppk public key

Ok @Adam and @Kimvais were right, Paramiko cannot parse .ppk files. So the way to go (thanks to @JimB too) is to convert .ppk file to OpenSSH private key format; this can be achieved using PuTTYgen as described here. Then it’s very simple getting connected with it: import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(‘<hostname>’, username=”<username>”, … Read more

Automating running command on Linux from Windows using PuTTY

Putty usually comes with the “plink” utility. This is essentially the “ssh” command line command implemented as a windows .exe. It pretty well documented in the putty manual under “Using the command line tool plink”. You just need to wrap a command like: plink root@myserver /etc/backups/do-backup.sh in a .bat script. You can also use common … Read more

How to convert SSH keypairs generated using PuTTYgen (Windows) into key-pairs used by ssh-agent and Keychain (Linux)

puttygen supports exporting your private key to an OpenSSH compatible format. You can then use OpenSSH tools to recreate the public key. Open PuttyGen Click Load Load your private key Go to Conversions->Export OpenSSH and export your private key Copy your private key to ~/.ssh/id_dsa (or id_rsa). Create the RFC 4716 version of the public … Read more