# Menu to prompt user when existing file will be deleted. # Specify if existing file should be overwritten or appended # Specify character to replace spaces with, otherwise '-' # Commandline option to write directly to local config Link: # PuTTY to SSH Config - BASH For Windows
I hope this is useful to folks who need to convert their PuTTY configs to SSH and am happy to take any feedback. On top of that, I have always wanted to make something that would be useful to others and this is the first time I feel that I am able to do that. Currently the script parses that following parameters into an SSH Config file for use with OpenSSH/Bash for Windows/Linux systems: This is exactly why tackling a project and forcing yourself to stick with it helps to teach so much.Ĭommand line options allow you to write to a specified file (defaults to the Bash for Windows config location), append a current file, and set a file prefix (location). You can also make your OpenSSH server keep alive all connections. Insert the following: Host ServerAliveInterval 300 ServerAliveCountMax 2. Add Private key to PuTTY SSH authentication agent 5. On Linux (ssh) To enable the keep alive system-wide (root access required), edit /etc/ssh/sshconfig to set the settings for just your user, edit /.ssh/config (create the file if it doesn’t exist). Configure your Linux server (create user, save public key) 4. Generate a private and public key pair 3.
Get the zip file with all PuTTY binaries 2.
Once the PuTTY Windows installer is downloaded, double-click the executable in the Download folder and follow the installation wizard. How To Configure SSH Keys Authentication With PuTTY And Linux Server In 5 Quick Steps. These two tools can be downloaded individually or, preferably, as a Windows installer from the PuTTY Download Page. Working on this (what most would consider) simple script forced me to work with loops, string manipulation, registry parsing, the help functionality within the script, and command-line option parsing. Both PuTTY and PuTTYgen are required to convert OpenSSH keys and to connect to the server over SSH.
With the release of Bash for Windows and the recent announcement that Microsoft will be bringing OpenSSH to Windows I figured this would be a good time to dive in and force myself to write a script in PowerShell to convert my PuTTY profiles to an SSH config. I have done a little bit of PowerShell work in the past but mostly just training exercises and modifying existing stuff.