1. [SSH] A painless one click SSH Terminal Desktop shortcut with PuTTY

    I wanted a Desktop shortcut to quickly open PuTTY SSH Terminal sessions to a remote Unix web server and auto login without the username input and password protection. What sounds simple needed some steps to setup. Here’s what I did:

    1. Generate keys

    To achieve the auto login on a SSH connection you need to create a public and a private encryption key and implement them at the remote server and at your local PC.

    Use PuTTYgen to generate the keys. Beginner’s hint: Yes, the keys are basically “just” a line of cryptic strings.

    • Save the private key line of cryptic strings to a txt file - later you will point PuTTY to it. 
    • Copy the public key to your clipboard. You will use it in just some seconds and then forget about it.

    2. Put public key to remote location

    Open up a new SSH connection to your desired remote machine. Do this one last time by entering you username and password. Add the public key string from your clipboard at the first or last line of a file called authorized_hosts on your server (usually you find it in a hidden .ssh folder in your ~home). Save the file. Ok, that’s it for the remote location. No apache restart or the like is needed. It should take effect next time you login.

    3. Launch Putty

    We will now change some settings in PuTTY to define the SSH connection route and add the private key. Finally we will save this as a session to be able to reconnect any time again quickly.

    4. Point PuTTY to your private key file

    Do so under Connection - SSH - Auth

    5. Get rid of typing in your username on each login

    Enter your username under Connection - Data - Login details

    That’s it for the auto login!

    By installing the public key to the remote server and the private key to your SSH client plus setting the standard username for the login you can directly login to your server without further hurdles.

    !!! Please note that by this you not just made your life more comfortable but also got rid of the complete login process and created big security hole. Be aware of that.

    9. Save the setup as session

    Name your session and click Save

    Now your login can be quickly recalled without entering a username and password. But you still have to start PuTTY first for choosing and loading the session. Let’s remove this step, too.

    10. Create a shortcut to your putty.exe on the Desktop …

    … and open up its properties. Modify the target field. Add a -load <name of PuTTY session> at the end of the comand line.

    e.g. “C:\Program Files\_port\Putty\putty.exe -load Blog” (Blog is the name of the session I want to launch here)

    Done! Now you have a shortcut on the desktop that launches a SSH connection to a remote location without the need of reentering credentials. Enjoy.