Score:0

VNC via SSH tunnel working or not, unkown causes

I have Ubuntu 20.04.3, in two computers PC1 and PC2. I can connect via VNC (remmina) between the two with no problem.

Now I try to use VNC via SSH tunnel.

  1. Set the tunnel

     [PC1]$ ssh -L 5900:localhost:5900 [email protected]
     bind [127.0.0.1]:5900: Address already in use
     channel_setup_fwd_listener_tcpip: cannot listen to port: 5900
     Could not request local forwarding.
     Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-41-generic x86_64)
     ...
    
  2. In remmina, connect with Protocol Remmina VNC Plugin (the same as a non-tunneled connection) to localhost:5900. I am asked for the password set in Settings -> Sharing -> Screen Sharing. I enter that password, and I get Could not authenticate, attempting reconnection....

The same happens when trying PC2 -> PC1 (via SSH tunnel).

A. How can I fix this?


I have another PC3, with Win10, and I want to VNC from PC3 to both PC1/2, using tigervnc. I can do that with no problem either.

Now I try to use VNC via SSH tunnel. I can do that PC3 -> PC1, using a mingw64 prompt in PC3, with

  1. In a mingw64 bash prompt,

    [PC3]$ ssh -L 5900:localhost:5900 [email protected]
    bind [127.0.0.1]:5900: Address already in use
    channel_setup_fwd_listener_tcpip: cannot listen to port: 5900
    Could not request local forwarding.
    Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-41-generic x86_64)
    ...
    
  2. In tigervnc, connect to localhost:5900. I am asked for the password set in Settings -> Sharing -> Screen Sharing. I enter that password, and I already have the VNC screen in PC3.

If I try to do the same with PC3 -> PC2, I get

  1. In a mingw64 bash prompt,

    [PC3]$ ssh -L 5900:localhost:5900 [email protected]
    bind [127.0.0.1]:5900: Address already in use
    channel_setup_fwd_listener_tcpip: cannot listen to port: 5900
    Could not request local forwarding.
    Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-41-generic x86_64)
    ...
    
  2. In tigervnc, connect to localhost:5900. I am asked for the password set in Settings -> Sharing -> Screen Sharing. I enter that password, and I get Authentication failure.

B. How can I fix this?


The following info may be useful: In PC1 I have

$ gsettings list-recursively org.gnome.Vino
org.gnome.Vino prompt-enabled false
org.gnome.Vino require-encryption false
org.gnome.Vino use-alternative-port false
org.gnome.Vino disable-background false
org.gnome.Vino disable-xdamage false
org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino icon-visibility 'client'
org.gnome.Vino authentication-methods ['vnc']
org.gnome.Vino network-interface ''
org.gnome.Vino notify-on-connect true
org.gnome.Vino mailto ''
org.gnome.Vino lock-screen-on-disconnect false
org.gnome.Vino use-upnp false
org.gnome.Vino vnc-password '<12-char string>'
org.gnome.Vino view-only false

In PC2 I have the same, except for

org.gnome.Vino vnc-password 'keyring'

And when I try to set the password in Settings -> Sharing -> Screen Sharing, I am limited to 8 characters, which is not the usual case I met.

Score:0

I fixed the difference between PC1 and PC2, which led to

PC3 -> PC1 (SSH tunnel): OK
PC3 -> PC2 (SSH tunnel): Failed

In /etc/ssh/sshd_config in PC2, I had set before for security reasons AllowTcpForwarding no. Commenting that line, I could connect.


I then fixed the SSH tunnel PC1 -> PC2

  1. Set the tunnel

     [PC1]$ ssh -L 5900:localhost:5900 [email protected]
     Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-41-generic x86_64)
     ...
    
  2. In remmina, connect with Protocol Remmina VNC Plugin (the same as a non-tunneled connection) to localhost:5902. I am asked for the password set in Settings -> Sharing -> Screen Sharing. I enter that password, and I get a remote desktop.

Same for PC2 -> PC1.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.