|
How to Run Bitvise SSH Client 24/7 as a Windows Service with AlwaysUp |
Ensure that the Bitvise SSH Client starts automatically when your computer boots. No need to log in first to start your port forwarding, etc.
Bitvise SSH Client
is a free and very mature SSH client application.
While it's built for conventional desktop use and features a flexible user interface, Bitvise SSH Client also includes several command line tools that support background operation.
In this tutorial, we'll show you how to set up stnlc (the tunneling/port forwarding component) as a Windows Service.
To install Bitvise SSH Client (stnlc) as a Windows Service with AlwaysUp:
-
Download and install Bitvise SSH Client, if necessary. Set up the software and confirm that it works as you expect.
For this tutorial, we:
- activated the port forwarding feature on our server, and
- saved our settings in a profile ("C:\SSH\port-forwarding.tlp"), which we'll use later on in step 5:
Note that if Bitvise SSH Client doesn't work at this point, it won't work with AlwaysUp either! Please be sure to test.
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the stnlc executable.
This is usually:
C:\Program Files (x86)\Bitvise SSH Client\stnlc.exe
-
-
In the Arguments field, enter the command line parameters to stnlc.
You should add -profile=<PATH-TO-PROFILE-FILE> to identify the profile with all your settings and -unat=y to indicate that stnlc should run unattended, without interaction.
-
In the Start the application field, select Automatically, but shortly after the computer boots.
This setting — which delays SSH client startup by about 2 minutes — should ensure that critical system services
(like networking and security) are ready and waiting when stnlc starts after a reboot.
-
In the Name field, enter the name that you will call the application in AlwaysUp.
We have used Port Forwarding but feel free to specify another name that is more meaningful in your situation.
-
Move to the Logon tab and enter the user name and password of the Windows account in which you installed Bitvise SSH Client. Doing that will
allow stnlc to find your profiles and settings.
-
Now once stnlc is running as a Windows Service, you won't see it on your desktop. That's because it will be running invisibly in the
isolated Session 0.
If you wish to record the output from the stnlc console — which may help when debugging — click over to the Extras tab.
From there check the Capture output to this log file option and enter a name for the log file.
And while you're here, you might as well tell AlwaysUp what to do when the log file grows very large:
-
We're done configuring Bitvise SSH Client so click the Save button to record your settings.
In a couple of seconds, an entry named Port Forwarding (or whatever you called it) will show up in the AlwaysUp window.
It is not yet running though so its state will be "Stopped":
-
To start Bitvise SSH Client, choose Application > Start "Port Forwarding".
In a few seconds, the state should transition to "Running" and stnlc will be up and running in the background:
-
And that's it! Next time your computer boots, Bitvise SSH Client will start up immediately, in the background, without anyone needing to log on.
Please restart your PC now and test that everything works as expected after Windows comes back to life.
Also, please feel free to edit Bitvise SSH Client in AlwaysUp and explore the many other settings that may be appropriate for your environment.
For example, send an email to your team if stnlc stops for any reason, boost its priority to give it more CPU, or recycle it weekly to cure memory leaks.
Bitvise SSH Client not working properly as a Windows Service?
-
If you captured stnlc's to a file (in step 7), check the log file for errors and warnings.
The console text could provide clues that help you discover why the connection is failing.
From AlwaysUp, select Application > Report Activity > Today to bring up an HTML report detailing the interaction
between AlwaysUp and Bitvise SSH Client.
The AlwaysUp Event Log Messages page explains the messages that may appear.
Consult the AlwaysUp Troubleshooter —
our online tool that can help you resolve the most common problems encountered when running an application as a Windows Service.
Browse the AlwaysUp FAQ
for answers to commonly asked questions and troubleshooting tips.
Contact us and we'll be happy to help!
|
Over 97,000 installations, and counting!
|
 |
|
Rock-solid for the past 20+ years!
|
Fully Compatible with 160+ Applications...
|