sshopensshssh-tunnelvnc-server

tigervnc not connecting with localhost


stuck from a couple of days. In ubuntu i'm creating vncserver with command line [tigervnc]

vncserver -localhost yes

to secure connection from only localhost. vnc is successfully created with port - 5901.

Im using putty to establish SSH tunnelling,

SSH tunnel

enter image description here

in realVNC viewer in using

localhost:9091

But it gives error saying connection refused.

  1. I want to establish a SSH tunnel with only localhost in order to avoid the brute force attack, getting too many authentication failure errors.

What am i doing wrong. Please guide me.

Note : connection works fine if i use vncserver -localhost no. But for security reasons i dont want this

  1. to allow connection from localhost only and to avoid brute-force attack in these any settings need to change in vnc-config or something.

Did a hell of research, couldn't resolve. StackOverflow is the last hope.


Solution

  • Localhost is 127.0.0.1

    You have to create SSH TCP FORWARD to localhost (or 127.0.0.1), not 103.16.26.144

    There is how I use this on my linux desktop, from a shell terminal.

    ssh -fL 9091:localhost:5900 user@103.16.26.144 sleep 2 &&
        xvncviewer localhost:9091