Batch file for PuTTY/PSFTP file transfer automation

You need to store the psftp script (lines from open to bye) into a separate file and pass that to psftp using -b switch: cd “C:\Program Files (x86)\PuTTY” psftp -b “C:\path\to\script\script.txt” Reference: https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter6.html#psftp-option-b EDIT: For username+password: As you cannot use psftp commands in a batch file, for the same reason, you cannot specify the username … Read more

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

Best way to script remote SSH commands in Batch (Windows)

The -m switch of PuTTY takes a path to a script file as an argument, not a command. Reference: https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter3.html#using-cmdline-m So you have to save your command (command_run) to a plain text file (e.g. c:\path\command.txt) and pass that to PuTTY: putty.exe -ssh user@host -pw password -m c:\path\command.txt Though note that you should use Plink (a … Read more

Convert PEM to PPK file format

Use PuTTYGen Creating and Using SSH Keys Overview vCloud Express now has the ability to create SSH Keys for Linux servers. This function will allow the user to create multiple custom keys by selecting the “My Account/Key Management” option. Once the key has been created the user will be required to select the desired SSH … 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