How Do I Sync a Folder Under a Different Profile

I have to Linux computers with dual matching profiles. I set up syncing with one profile and it works fine. I tried to add syncing of a directory on another profile but I got “permission denied”. I tried to change the default folder path to “/home” and restarted, but it did not work.

How do I set up syncing on a second profile?

Hello and welcome,

this seems to be rather a linux question, not a syncthing question - are you sure the user you are trying to give access to a folder has WRITE permissions to said location? (try creating a file or folder at that location)

E.g. if you are literally trying “/home/” - it is typically not writable by anybody but root , so you may want to use e.g. “/home/{username}/Documents”

Don’t sync your entire personal home folder (“/home/{username}”, AKA “~”), it will be a mess, for various reasons!

1 Like

I have set up syncthing in the profile of user1 with the path of /home/user1. I set up syncing to a few folders inside the /home/user1 folder and tested send/receive on both computers. It works perfectly.

If I sign into user2 profile on both computers, I try to add a new folder I see this /home/user1 as the default folder.

Path to the folder on the local computer. Will be created if it does not exist. The tilde character (~) can be used as a shortcut for /home/user1

If I go to Actions > Advanced > Default Folder I change the path to /home/user2 that will set the default path globally not locally.

I am using Fedora 36.

I think what I need to know is how to set up syncthing per user profile.

There have been a number of earlier forum posts discussing various options for setting up Syncthing on a multi-user system.

The most flexible, and least complicated solution is for each user to run an individual instance of Syncthing – no complicated permissions issues to deal with and every user manages their own Syncthing folder settings.

The only difference between running Syncthing for 1 user vs. 100 users is making sure that every user chooses unique network port numbers for Syncthing’s web GUI (8394) and sync protocol (22000).

To make the sysadmin side easier, consider assigning network port numbers that match a user’s UID and GID. With the exception of root, most users get the next available UID:GID starting at 1000. Because network port numbers 1 to 1024 are generally reserved for use by the OS, users must start with port 1025. For example, with two users named “jack” and “jill”:

User  UID   GID   Web UI  Sync
jack  2001  2002  2001    2002
jill  2003  2004  2003    2004

See Syncthing’s Firewall Setup documentation for more network configuration details.

For starting Syncthing, first decide whether Syncthing should continue running when a user isn’t logged on, then choose from one of several options including:

  • systemd auto-starts all Syncthing instances at boot time.
  • Users individually enable auto-start with systemd.
  • Syncthing starts when a user logs on and stops when a user logs off (can be done via systemd, Syncthing-GTK, SyncThingy, etc.)
1 Like

Thank you sir for the detailed response. I did find this article on how to set that up. I attempted to do that but when I sign into configure user2 I see the setting for the user1 and when I change the setting for user2 it changes the setting for user1.

I think I will start over from scratch and if I have a problem I will reply in this thread.

I have found this documentation that look promising using systemd. I have to enable and start the service as the user I am logged in as (without sudo).

$ systemctl --user enable syncthing

$ systemctl --user start syncthing

Then I will set a unique ports for each user.

The command to start Syncthing is optional because you can also just log off and log back on once the service has been enabled. Note that by default, Syncthing will start and stop with the user’s session, i.e., Syncthing only runs when the user is logged on.

I’d delay setting up auto-start and just temporarily start Syncthing manually from a terminal window until you’re satisfied with the settings. The runtime messages printed by Syncthing are helpful with debugging.

1 Like

It is working now. I ran these commands (without sudo) in each user profile.

$ systemctl --user enable syncthing

$ systemctl --user start syncthing

Then I was able to configure different port numbers for each user.

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