Makefile error make (e=2): The system cannot find the file specified

The error process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, …) failed. make (e=2): The system cannot find the file specified. is almost certainly complaining that Windows cannot find pscp. This is almost certainly because the value of %PATH% (or whatever) is different when make spawns a shell/console then when you have it open manually. Compare the values … Read more

Script via Plink in .bat behaves differently

In the other cases, you are using interactive sessions. While the Plink uses non-interactive session by default, when you specify a command on its command-line. Your script probably relies on some environment variables (like PATH) being set specifically. It’s quite probable that the variables are set only for interactive sessions. Probably because they are modified … Read more

Git Bash and Pageant are not using keys

This is what ended up working for me. BTW, I do have Bash on Windows as well, but I don’t think that matters. I had Sourcetree installed and pointed at its folder with plink.exe, puttygen.exe, & pageant.exe. You could also download and install these separately as well. Configure Windows Environment Variable Type Environment into your … Read more

Automating command/script execution using PuTTY

PuTTY has the -m switch, that you can use to provide a path to a file with a list of commands to execute: putty.exe user@example.com -m c:\local\path\commands.txt Where the commands.txt will, in your case, contain a path to your shell script, like: /home/user/myscript.sh Though for automation, your better use the Plink command-line connection tool, instead … Read more

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