I need to use OpenGL on a remote Win 10 computer so can't use RDP. I also need a secure connection so VNC over SSH looks like a good solution.

So far I've installed and configured OpenSSH and TightVNC servers on the remote Windows computer. I've confirmed TightVNC server is listening on port 5900.

I then followed this guide to configure PuTTy with port tunneling.

I've also set AllowTcpForwarding yes in sshd_config on the remote computer.

I can successfully connect/login to the remote Windows computer using PuTTy with tunneling setup for port 5900.

But when I try to connect to or localhost:5900 in the TightVNC viewer it fails to connect giving "Connection has been gracefully closed" error.

What am I missing?

2 Answers 2


Got it working, I was entering the IP I wanted to tunnel to in PuTTy tunnel config not I don't know why this works, some docs say to use and other say to use the IP of the remote machine.


I was hitting the same error message.

But in my case it was not just a matter of Putty configuration, but also Windows 10 OpenSSH server and TightVNC server configurations.

So I share all of them just in case somebody else is having the same problem:

** Remote Windows 10 OpenSSH server configuration (see links below if you wish to change your server port). These are some directives I changed in the OpenSSH config file (%programdata%\ssh\sshd_config):

PermitTunnel yes # default: no
AllowTcpForwarding yes # default: no

** Remote Windows 10 TightVNC server configuration:

"Access control" tab menu entry, "Loopback Connections" section: Tickbox "Allow loopback connections" yes (default: no)

** Local Putty configuration:

Left menu: Session Host name (or IP address) and port: use IP and OpenSSH server port of your remote Windows 10 (in my case, lets say they are / 22).

Left menu: Connection - SSH - Tunnels. I added these entries:

Source port: 5908 (the local port you will use to enter the tunnel)

Destination: (the port your remote TightVNC server is listening)

These two ports do not need to be identical. In my case I preferred to use 5908 source port (just to remember it tunnels to my remote server at

With the above configuration, my VNC client can access the server connecting to:

I also read these links regarding OpenSSH server configuration in Windows 10:

Installation: https://virtualizationreview.com/articles/2020/05/21/ssh-server-on-windows-10.aspx

Configuration: How to change ssh port on windows 10?


Tunneling: http://woshub.com/ssh-tunnel-port-forward-windows/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.