Connect to remote server WEBUI with ssh -D8080 and a dedicated browser?

How are you connecting to your remote servers running syncthing?

I used to use

ssh -D8080 host

…and then set a dedicated browser to use the dynamic socks proxy that ssh has set up from that. (proxy: 127.0.0.1:8080)

I used to use Firefox and foxyproxy for this, but then there were some changes to security and I ended up using Chromium. But then Chromium changed as well so that it wants to use the system wide proxy settings, so I started using SwitchyOmega for Chromium. But now that isn’t working. I tried ‘links’, the cli console curses browser, but it doesn’t seem to have java script.

What do you use?

Correct, links doesn’t support JavaScript, but even if it did, there’s also no CSS (Cascading Style Sheets) support.

Although ssh -D is an option, it’s a bit overkill because connections aren’t limited to just a single port – it’s allowing apps on the client to connect to any port and/or network interface on the remote host.

A simpler and more secure option is to forward just the required port. Then you won’t need to change proxy settings and/or rely on web browser add-ons.

For OpenSSH, the command syntax is as follows:

ssh -L local_port:host:host_port user@remote_host

For example…

ssh -L 1234:127.0.0.1:8384 logmein@10.10.10.10
  • ssh – OpenSSH client.
  • -L – Forward a local network port.
  • 1234 – A locally available network port to listen on.
  • 127.0.0.1 – Host to forward connections to.
  • 8384 – Network port on the specified host being forwarded to.
  • logmein@10.10.10.10 – Remote host to tunnel to, logging on as logmein.

Now choose any suitable web browser – no proxy changes and/or proxy add-ons required – and go to http://127.0.0.1:1234/.

Connections to local port 1234 are tunneled thru remote host 10.10.10.10 and forwarded to 127.0.0.1:8384 where Syncthing’s built-in web server is waiting for connections.

For convenience, add the following OpenSSH configuration block to ~/.ssh/config:

Host syncthing-webui
	LocalForward 127.0.0.1:1234 127.0.0.1:8384
	HostName 10.10.10.10
	User logmein

Then to open the SSH tunnel, refer to the host alias:

ssh syncthing-webui
6 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.