How do I reduce these two commands to one? I am connecting from my client to an x11vnc server and the two commands below already work. I just wish to do it in one step:
ssh -fNL 5901:localhost:5678 -i ~/.ssh/some_id_rsa email@example.com
From reading the man page, it seems like the -via option might do it. Unfortunately, the man page leaves me very confused. For reference (not that I understand it) here is what my man page says:
-via gateway Automatically create encrypted TCP tunnel to the gateway machine before con‐ nection, connect to the host through that tunnel (TightVNC-specific). By default, this option invokes SSH local port forwarding, assuming that SSH client binary can be accessed as /usr/bin/ssh. Note that when using the -via option, the host machine name should be specified as known to the gateway machine, e.g. "localhost" denotes the gateway, not the machine where vncviewer was launched. The environment variable VNC_VIA_CMD can override the default tunnel command of /usr/bin/ssh -f -L "$L":"$H":"$R" "$G" sleep 20. The tunnel command is exe‐ cuted with the environment variables L, H, R, and G taken the values of the local port number, the remote host, the port number on the remote host, and the gateway machine respectively.