Catalina: cannot use vnc://localhost:port to connect remote linux through SSH tunnel
Hello all!
In our university we have an students lab with 200+ Linux machines running Ubuntu-18.04 with Xvnc as vnc server listening in port 5900. Access to lab is only allowed by on demand opening port 22 (ssh) in lab's firewall
We want to allow students access those computers via VNC through SSH tunnels, so just open terminal in Mac and use the "standard recipe" to create such tunnel:
ssh -L 5999:127.0.0.1:5900 -N -f user@remote.linux.host
And then try to connect by mean of command "open vnc://127.0.0.1:5999"
But in OSX-Catalina "open vnc://127.0.0.1:5999" does not work: VNC connection is catched by Remote Sharing software and a password to get local screen access is requested. This allways happens, regardless of Remote Sharing or Remote Management activation state
I know that Mac Remote Sharing uses port 5900, so I've avoided these (local) port and checked different ports with no luck: vnc request is allways catched when either host 127.0.0.1 or localhost is typed, regardless port number
We've also tried vnc URI syntax as stated in RFC 7896 (RFC URI scheme)
https://tools.ietf.org/html/rfc7869 by mean of use parameters ChannelType, SshHost SshPort, and so with also no luck: Seems that MacOSX Catalina does not comply with RFC 7896
By the way: using and alternate VNC Viewer (TigerVNC+XQuartz) everything works as expected
with any of these commands: ( notice the double colon to select port, not display )
- vncviewer localhost::5999 ( using the created ssh tunnel )
- vncviewer remotehost::5900 -via user@remotehost ( create ssh tunnel "on the fly" )
So my questions:
- Which parts of RFC 7896 are handled by Apple's OSX-Catalina implementation of vnc:// uri ?
- How can I stablish a VNC-through-SSH-tunnel in Catalina to connect a remote Linux box _without_ using an alternate VNC Viewer, but native "open vnc://" mechanism ?
- How Can I bypass catching of "vnc://localhost" request for the Remote Sharing engine to get it working as expected?
Thanks in advance
Juan Antonio Martínez
iMac 27″, macOS 10.13