How to run PuTTY Link as a Windows Service.
What is PuTTY Link?
Plink (PuTTY Link) is a command-line network connection tool that automates connections to an SSH server.
Can PuTTY Link be run as a Windows Service?
The application can be run as a Windows Service using FireDaemon Pro, which allows you to have the application start automatically at boot prior to login, start multiple instances of the application and more. You can also use Fusion to manage FireDaemon and other Windows services via a web browser.
How to se up PuTTY Link under FireDaemon Pro
- Download the latest stable PuTTY zip.
- Extract the download someplace on your hard drive. For the purposes of this HOWTO, we will be using C:\PuTTY
- Note: PuTTY and Plink do not have the ability to encrypt your connection details. They are either stored as plain text in the command line or plaint text in the registry. So if security is your main concern, then you should not use PuTTY but rather PuTTY CM. The HOWTO for Putty CM is here.
- Download and install FireDaemon Pro into the directory of your choice, typically C:\Program Files\FireDaemon.
- Next start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Adjust the paths to suit your installation. Pay special attention to the Parameters list.
- Executable: The path to your plink.exe file. For the purposes of this HOWTO, the path is C:\PuTTY\plink.exe.
- Working Directory: The directory containing your plink.exe file. For the purposes of this HOWTO, the path is C:\PuTTY.
The most important field on the tab is the Parameters. The Parameters define the initial setup of your SSH connection.
Here’s the full parameter list you should have:
-ssh -2 -L localhost:<srcPort>:<HOSTNAME>:<destPort> -l USERNAME -pw PASSWORD <HOSTNAME>
- "-ssh -2" Forces use of SSH with SSH protocol 2.
- "localhost:<srcPort>:<HOSTNAME>:<destPort>" Opens an SSH tunnel with a local tunnel port, the server's hostname and the server's port. For example: localhost:1337:188.8.131.52:80
- "-l USERNAME" The username of the SSH account. Replace USERNAME with your username.
- "-pw PASSWORD" The password of the SSH account. Replace PASSWORD with your password.
- "<HOSTNAME>" The hostname of the SSH server. It can be an IP or URL.
Now click on the Settings tab. If you DON'T want to see Plink running, uncheck the Interact with Desktop check box & select "Hidden" from the "Show Window" dropdown. You must run Plink as the user you installed it as. In the Logon Account field type your username (e.g. Administrator) and then enter the user's password twice in the Password and Confirm fields. You can change the Process Priority to allocate more CPU time to Plink or specify which CPU or core Plink will run on (in the case of multi-processor, hyperthreaded or multi-core CPUs).
Now click on the Lifecycle tab. Uncheck Graceful Shutdown as it can slow the shutdown of Plink.
Now click on the OK button to install and start PuTTY Link!
NOTE: When you start Plink manually or as a service for the first time a window will appear asking if you want to save the host key. Click the "Yes" button.