Simple scenario:
When I want to SSH from A to C, I simply do this:
So far so good. Now I setup a bhyve VM on host C. VNC is set to
In order to access the bhyve VM via VNC from my desktop host A, I created an SSH tunnel (on desktop A):
Then I tried connecting my VNC client to
What am I missing here? The SSH tunnel should take me straight to 192.168.1.10 and from there I should be able to access the VNC server listening on 127.0.0.1:5900. Therefore, I also shouldn't need to open port 5900 on host C's firewall, correct?
Code:
Desktop [A] ---- <internet> --- SSH jumphost [B] --- <local net> --- bhyve host [C]
When I want to SSH from A to C, I simply do this:
ssh -J user@jump.example.com user@192.168.1.10
where jump.example.com points to B and 192.168.1.10 is the local address of C (reachable by B). Using this method, I can successfully SSH from A to C.So far so good. Now I setup a bhyve VM on host C. VNC is set to
127.0.0.1:5900
. According to sockstat -4 -l
(on C) the port is open and bhyve is listening on it (just on the loopback interface).In order to access the bhyve VM via VNC from my desktop host A, I created an SSH tunnel (on desktop A):
ssh -p 22 -f -N -L 5900:192.168.1.10:5900 user@jump.example.com
Then I tried connecting my VNC client to
localhost:5900
- unfortunately unsuccessfully. The VNC client (TightVNC) immediately tells me that the "Connection has been gracefully closed".What am I missing here? The SSH tunnel should take me straight to 192.168.1.10 and from there I should be able to access the VNC server listening on 127.0.0.1:5900. Therefore, I also shouldn't need to open port 5900 on host C's firewall, correct?