Last active
February 11, 2026 04:24
-
-
Save composite/80c90af7c15f737e6ccd1a01fde829e9 to your computer and use it in GitHub Desktop.
Bitvise SSH Client as a Windows service with NSSM example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @REM How to use before run this batch: You need Bitvise SSH Client and NSSM. if you haven't, google it and download and install. | |
| @REM 1. open bitvise SSG Client | |
| @REM 2. click "New Profile" to save profile. | |
| @REM 3. configure SSH infomation, tunnels, etc. | |
| @REM 4. click "Save Profile" to save profile. | |
| @REM 5. on "sensitive" dialog popup, check "any account on this computer" or below to service account can connect it. | |
| @REM 6. click "Login" to connect and test SSH Connection. | |
| @REM 7. click "Accept & Save" if you see host key dialog popup. | |
| @REM 8. Click "host key manager" | |
| @REM 9. select your SSH host and click "Export". then click "Bitvise format" and save host key file. | |
| @REM 0. that's it. then edit this file in your favorite editor to change profile and host key path. and RUN IT. | |
| @SETLOCAL | |
| @reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT | |
| @if %OS%==32BIT SET BITVISERUN=C:\Program Files\Bitvise SSH Client\log.exe | |
| @if %OS%==64BIT SET BITVISERUN=C:\Program Files (x86)\Bitvise SSH Client\log.exe | |
| @REM SET BITVISERUN=C:\Path\to\Bitvise SSH Client\log.exe | |
| @SET LOGPREFIX=C:\path\To\log | |
| @SET BVPROFILE=C:\path\to\profile.tlp | |
| @SET BVHOSTKEY=C:\path\to\hostkey.pub | |
| @REM Use below if you are using password only. you can change service name on "BitviseSSHClient" part. | |
| nssm install BitviseSSHClient "%BITVISERUN%" -tcx "%LOGPREFIX%" stnlc -profile="%BVPROFILE%" -hostKeyFile="%BVHOSTKEY%" | |
| @REM If you need connect with key file, prepend @REM to comment and use steps below. | |
| @REM If you want use connect with client key file, Use "Client key manager" in UI, select key profile, click export, check "private key" and save. then set exported key file path below: | |
| @SET BVCLNTKEY=C:\path\to\privatekey | |
| @REM Uncomment(remove "@REM") if you use client key instead. | |
| @REM nssm install BitviseSSHClient "%BITVISERUN%" -tcx "%LOGPREFIX%" stnlc -profile="%BVPROFILE%" -hostKeyFile="%BVHOSTKEY%" -keypairFile="%BVCLNTKEY%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment