SSH WebGUI forwarding headless server

I installed SyncThing on a Centos 7 headless VPS server and the ssh connection is successful, however when I try to open 127.0.0.1:9090 in a browser the page doesn’t load and the ssh session throws the following error:

channel 3: open failed: connect failed: Connection refused

The issue was described here before here: issue with ssh forwarding but I do not clearly know what steps to follow in this case to get to a solution.

Please post the actual command or configuration you used to set up the SSH tunnel. Syncthing by default listens on port 8384 for GUI access. So at least on the remote system, that’s the port you need to specify probably.

2 Likes

ssh -L 9092:localhost:8384 user@ip

syncthing cli errors show

Get “http://127.0.0.1:8384/rest/system/error”: dial tcp 0.0.0.0:8384: connect: connection refused

I am not sure if it actually runs because of this:

syncthing[11497]: [GSJLT] WARNING: Failed starting API: listen tcp: address tcp/8384": unknown port
Jul 09 03:54:43 .cloud syncthing[11497]: [GSJLT] INFO: QUIC listener ([::]:22000) shutting down
Jul 09 03:54:43 .cloud syncthing[11497]: [GSJLT] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down

Looks like the configuration for what port the GUI should listen to is malformed, containing an extra quote character. Check config.xml and correct as required.

There are multiple errors involved here.

  1. As @calmh pointed out, apparently the service doesn’t even start because of a malformed address in config.xml.
  2. In your initial post, you said the browser refused to connect on port 9090, while your SSH command uses port 9092.
  3. If you run syncthing cli errors show on your local device, you need to pass --gui-address, in your case the forwarded local port localhost:9092, and --gui-apikey with the API key of the remote machine where syncthing runs.
  4. If you run the same command on the remote machine and it shows connection refused, then Syncthing is indeed most probably not running.
1 Like

Thank you. Indeed when I had a problem at the start I probably introduced additional problems along the way.

  1. Yes. I removed the " at both sides of the address after the = sign. I would have never seen this.

  2. Yes, I changed it from 9090 to 9092 among others try if this helped solve the issue

Thank you I worked with your feedback and got it to work! Thank you so much.

2 Likes

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