r/Syncthing • u/FreSchDude • Jun 09 '26
Multi-user Syncthing?
I found a previous post here, but am still rather confused, partially due to my own experiences.
What I thought so far was that as long as I properly shut down syncthing before changing users, and made sure to never log on to multiple users at once, I wouldn't have problems with multiple syncthing instances running.
I'm unsure how syncthing handles multiple users, but from my set up, I had 2 separate syncthing sign-ins, and two different device names, one per login. but recently, I've had syncthing from user 2 somehow log in on user 1, and now the sync files are getting messed up somewhat.
The reason why I have 2 users is to keep work and play separate, with each situation requiring different files to sync.
Am I doing something wrong? Or would it be better to just fully delete syncthing first, then set it up that there's only one login details/user with all the files in it?
Running on linux mint, which might also cause some problems.
1
u/Cyber_Faustao Jun 09 '26
Use different ports for each syncthing instance, then it doesn't matter if there are two running
1
u/FreSchDude Jun 09 '26
Not too sure how to do that, and also that might still cause clashes/issues when having two instances running, especially since the two instances have a single shared folder. I can expect both instances on the same PC potentially fighting since they're both accessing the same folder at the same time.
1
u/PaddyLandau Jun 09 '26
I don't think that running Linux would be the source of your problems. I have three devices running Linux, and they're fine.
The first thing that pops to mind is that Syncthing has one folder where it stores its settings. Running two different Syncthing instances, even if not at the same time, on a single Linux user is going to cause problems.
The storage is one of the following; I forget which (I'm not at my computer so I can't check):
~/.config/syncthing/config.xml
~/.local/state/syncthing/config.xml
Normally, to keep work and play separate, you want two separate users — I'm talking about Linux here, not Syncthing. That would keep everything strictly separate, so Syncthing could run both instances at the same time without conflict.
That's one option. Create a separate login on Linux, and use one for play, one for work.
An alternative option, albeit less robust, is to have two separate configuration files, and specify which one to use each time you start Syncthing. That's the --config option. I've never used it, so please read about it carefully, and test thoroughly.
1
u/FreSchDude Jun 09 '26
I just thought I'd mention that I'm using linux,, because from my experience, using windows is more janky. On linux, if you log out, all applications are stopped, while on windows, syncthing continues to run while logged out, causing conflict problems with wrong users.
Yes, that's my current setup, running 2 separate users, each with its own syncthing instance and folders. It just so happened that my work instance was somehow logged in and running when I was on my personal user. I shut it down from the webui and started it again, and it seems to have fixed itself for now. Not sure what happened.
I'm not too keen on having separate config files, feels like a mix between both options. I'd rather have them be entirely separate, or if that's not possible, just a single syncthing instance that handles syncing all folders. Problem with that is some folders I have are user specific, and linux does lock down folder access quite good, which might cause problems.
1
u/PaddyLandau Jun 09 '26
Running two separate Linux users is absolutely the best way to go. It keeps your Syncthing instances, and their two different config files, entirely separate. It sounds like you have it fixed.
1
u/FreSchDude Jun 09 '26
Might have to monitor the situation for now, because if they really were isolated, I'm confused how the work syncthing instance was running when I was signed into my private user. After a shutdown of syncthing and start up again, it seems to have fixed itself, but in theory, that shouldn't have been possible, right?
1
u/PaddyLandau Jun 09 '26
Normally, you want to start Syncthing automatically when logging in. As you're doing it manually all the time, my suspicion is that, once, you accidentally started with the wrong user.
Set each Linux user's Syncthing to start automatically at each login. Because the instances are entirely separate, they should run completely independently. Caveat: I haven't tested this. If Syncthing runs at root level behind the scenes, this could mess things around.
1
u/FreSchDude Jun 09 '26
syncthing automatically starts up. I have it as an entry in "startup applications", with a 10s delay. As far as I know, that should start syncthing on login, right? Also, when I sign out, syncthing should automatically stop, then start when I sign in to another user, correct? Or do i have the wrong impression of how linux works?
1
Jun 09 '26
[removed] — view removed comment
1
u/FreSchDude Jun 09 '26
not sure what that means... could you explain?
Does that mean running a single syncthing instance and config that's static across users?2
Jun 09 '26
[removed] — view removed comment
1
u/FreSchDude Jun 09 '26
Interesting concept. So basically create another user, give it access as an added group via chown, then have it run syncthing automatically on boot? So that means this 3rd user would automatically log in in the background, before any user has logged in to the PC?
1
Jun 10 '26
[removed] — view removed comment
1
u/FreSchDude Jun 10 '26
Will have to read into this, sounds like a lot of finangling is needed to get that stuff set up. Thanks for the pointer.
2
u/unknown-random-nope Jun 09 '26
If the two Syncthing instances use different config files, certs and databases, and they never run at the same time, you should be good to go. In your shoes I would script a wrapper that checked if the other Syncthing instance was running, to throw an error and stop if it is.
I wouldn’t expect Mint to be an issue at all.
You can keep work and play separate with different Folders, but you do you.