Environment:

  • Client (local machine), has access to remote (server)
  • Service running on server but only accessible via server’s localhost / 127.0.0.1
  • Commands run on client

Command:

ssh -L {local-port}:localhost:{remote-port} user@host [-p port]

This will open a tunneled connection. You should then be able to access the service via your web browser, on http://localhost:local-port.

E.g.

ssh -L 9001:localhost:8384 user@vimoire.com

Assuming the syncthing service is running on the server at its default port, the above opens a tunnel to access the server’s syncthing web interface from http://localhost:9001 on the client.