1

From my laptop, I am trying to open remote desktop in server2:

This is how it looks like:

my-mac-laptop -> vpn. ---> server1(redhat)  ->  server2(mac-server)
                           <----------same network---------------> 

Here, I can't access server2 directly. I have to connect to server1 via VPN. And from server1 I can access server2(mac-server).

I have already enabled Remote Login and Remote Management in the server2(mac-server).

Followed to that, I am attempting to port forward the remote desktop ports with the following command:

ssh -L 5900:server2-ip-address:5900 user@server1

My understanding has been this will tunnel all the remote desktop traffic to the server2(mac-server) in my mac laptop.

In the next step, I open screen-sharing app from my mac laptop and type localhost which should forward 5900 traffic to mac-server2 over the ssh-tunnel.

I even get the following prompt which means the port forwarding is happening:

Screen Sharing requires a user name and password to sign in to 127.0.0.1:5900.

Followed to that, I give the user name and password and then it loops for a long time standing "Connecting..." and eventually fails.

I am wondering whether there is logging somewhere that I can check to triage this issue.

I would like to know how I can triage this case, any ideas welcome.

Are there logs in the mac-server2 that might assist me to debug?

  • IIRC the Screen Sharing app does something a little weird when connecting to localhost. When I do this, I use port 5901 instead (i.e. ssh -L 5901:server2-ip-address:5900 ..., then from the Finder do View menu > Connect to Server (Command-K), and connect to vnc://127.0.0.1:5901. I'm not sure all that's necessary, but it works for me. – Gordon Davisson Jun 5 at 3:51
  • @GordonDavisson thanks for the pointer. I just attempted with the above steps and get the same issue. I get the prompt ""Screen Sharing requires a user name and password to sign in to 127.0.0.1:5901." and then I give the user:pass and then it gets stuck. – Exploring Jun 5 at 5:32

You must log in to answer this question.

Browse other questions tagged .