I had configured OS X screen sharing over an ssh tunnel and at some point it stopped working. The ssh tunnel would work:
ssh -L 1202:localhost:5900 [email protected]
However, when attempting to make the screen sharing connection (vnc://localhost:1202
), the remote host would error with
channel 3: open failed: administratively prohibited: open failed
I have the following in my remote host's ~/.ssh.config
:
AllowTCPForwarding yes
PermitOpen any
The missing element was an entry in the remote host's /etc/hosts
that defined localhost
. I added the following to that file and screen sharing over ssh tunnel was restored:
127.0.0.1 localhost