Make sure the startup type is set to automatic. Once this is done, start the service by running services.msc, looking for your service, right click and select start. Specify the location of your batch file in the Path: section, then click Install service. Then, open an administrator command prompt, cd to the directory containing nssm.exe, and enter the following: nssm.exe install autosshĪ GUI will open up. Obtain NSSM from here and extract it to a location you can remember. Once it’s a service it can be started automatically on startup, even if nobody has logged in yet. The Non-suciking service manager is a nifty little program that lets us turn anything into a windows service. In my case, I do -R5700:localhost:5900 which instructs my ssh server to listen on port 5700, then forward that connection to the Windows machine on port 5900 for VNC. I add the reverse port forward option ( -R ) so that I can simply connect to my ssh server on the specified port and the connection will tunnel through to the Windows computer. Update it to reflect the path of your cygwin installation if you installed somewhere other than the default location. cmd file on the Windows machine in a location of your choosing with the following: c:\cygwin\bin\autossh.exe -M -i -l -R -o StrictHostKe圜hecking=no -o UserKnownHostsFile=/dev/null On the windows machine a simple command gets us up and running. Now if you create SSH tunnels your SSH server opens those ports for you to connect from other machines. Save the file and restart the SSH service. Simply edit /etc/ssh/sshd_config and add GatewayPorts yes This turns your SSH server into a gateway for any port forwards. One option that I really enjoy on my SSH server is the GatewayPorts option. ssh folder and everything inside of it is 600
0 Comments
Leave a Reply. |