I have a number of systems synchronising with my home server machine. I am away from home at the moment and want to add another remote system (it’s a Raspberry Pi). I don’t have GUI access to the home server.
I have installed syncthing on the Pi and can access its GUI from my laptop. I have added my home server as a ‘remote device’ but how do I get my home server to accept this new remote? I have ssh/command line access to the home server, is there any way I can do this using the command line, either by using ‘syncthing cli’ or by editing the ~/.config/syncthing file?
Ah, yes, thank you. That should work though it’s a little more complicated because my ssh access to the home server is already going through a proxy. Still, I’m sure I can puzzle it out!
from your remote location are you able to open up an SSH connection, in this case for tunneling over ssh.
Tunneling via SSH
If you have SSH access to the machine running Syncthing but would rather not open the web GUI port to the outside world, you can access it through a SSH tunnel instead. You can start a tunnel with a command like the following:
ssh -L 9999:127.0.0.1:8384 user@Syncthing.server.at.home.or.work
This will bind to your local port 9999 and forward all connections from there to port 8384 on the target machine. This still
works even if Syncthing is bound to listen on localhost only.
In plain English, this command creates a secure encrypted tunnel between your remote PC and the server running syncthing. If you left Syncthing GUI at its defaults, this tunnel will let you bring up the remote management console in a browser tab on your remote machine so you can create the connection that you are interested in creating.
The “-L” tells ssh client you want to create a tunnel.
9999 is a local port on your remote PC that you will use to connect to the remote GUI. It can be any open port number.
The :127.0.0.1:8384 after the 9999 tells the ssh server you want your packets forwarded to the localhost only, and specifically on port 8384, which just happens to be the port the GUI admin console is listening on.
email@example.com should be obvious.
When you get prompted to type in the word yes to accept the server hash say yes.
Once you are successfully logged in go to your local browser open the new tab to the following address:
if there’s a password set on the remote server then you should be prompted for that information.
Yes, yes, OK.
I have a reverse tunnel set up from where I am now (laptop and Pi running syncthing on CGNAT internet connection) that goes through a proxy to my home server.
The reverse tunnel allows me to connect back to here when I’m at home.
The proxies are used so that my home server allows ssh access from only two specific IP addresses.
Regardless of all the above the simple:-
ssh -L 9999:127.0.0.1:8384 firstname.lastname@example.org
works perfectly. ssh is a very clever thing!
So, I was able to see the syncthing GUI on my home server and configure what I needed. I was expecting the connection through a proxy to be a problem but it wasn’t, as I said, ssh is very clever!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.