How to set up sync with non-GUI remote?

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?

https://docs.syncthing.net/users/firewall.html#tunneling-via-ssh

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! :slight_smile:

@chrisisbd ,

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.

user@syncthing.server 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:

127.0.1.0.1:9999

if there’s a password set on the remote server then you should be prompted for that information.

Leo

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 me@server.at.home

works perfectly. ssh is a very clever thing! :slight_smile:

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!

3 Likes

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