
Set /p KEYCACHE=Scan and cache SSH key (y/n) ? Type "nmap_temp2.txt" | repl " " "" > %IPFILE% Rem remove hidden space at end of IP (requires "repl" be in the batch file directory) Rem nmap formatting is not correct, the following removes extra infoįor /f "tokens=2" %%A in (nmap_temp.txt) do echo %%A > nmap_temp2.txt Nmap -open -n -p22 %RANGE% -oG - | findstr /E Up > nmap_temp.txt Nmap -open -n -p22 -iL %IPFILE% -oG - | findstr /E Up > nmap_temp.txt Rem Check whether IP type is "range" as nmap cannot read an IP range from file and must be type directly in nmap command Set /p SCAN=Do Nmap scan first? (recommended): Rem You must modify the CACHEKEY and SCRIPT section to reflect your SSH key locationĮCHO (Working directory is set to C:\Program Files\PuTTY\scripts\)ĮCHO Enter the IP range(s) as in the following example. This is mostly useful for having a single script (such as updating an SSL certificate) across a range of machines The NMAP and PuTTY working directories are in your command path batch/scripts/IPlist files installed in C:\Program Files\PuTTY\scripts\ģ.
#PUTTY COMMANDS FULL#
you have the full PuTTY package and SSH key installed in C:\Program Files\PuTTY\Ģ. want to avoid IPs putty cannot connect to, avoiding script being able to continue properlyĭ) optionally run pscp command to autocache the host key (putty does not do this automatically)ġ. Just thought I'd insert the script I made to hopefully save some people hours of syntax and man page researchī) script name to run on the IP/range (actual unix sh/ksh type script)Ĭ) optionally do nmap scan for port 22 open (i.e. If this works, you should be able to use ssh like you would on a *Nix: C:\WINDOWS\system32>ssh "ls -l ~"
#PUTTY COMMANDS WINDOWS#
Once installed, you can simply fire up your command line and use the OpenSSH client by typing ssh followed by the command such as ssh is the current (as of November 28, 2017) ssh command usage guide we are getting with the Windows OpenSSH Client: C:\WINDOWS\system32>ssh


#PUTTY COMMANDS INSTALL#
The idea of running another remote service on Windows can be daunting so we do not blame you if you do not want to install the server. You can then scroll down the list and find the OpenSSH Client (Beta) and OpenSSH Server (Beta) features in Windows. go to “Manage Optional Features” then + “Add a feature”.

If you're using Windows 10, you might be interested to know that Microsoft reportedly has a beta of OpenSSH (client and server):
