permission denied when attempting to accept folder from another device

Hi everyone, I am running syncthing as a systemd service on my NixOS machine. There are a couple of things that are confusing me and are giving me headaches.

  1. It sets the ~ as /var/lib/syncthing
  2. I am getting the following errors when I try to sync it in my home directory: /home/<username>/<folder_to_sync> See below:
<small>2024-11-21 20:36:47:</small> Loading ignores: lstat /home/<username>/Roam/.stignore: permission denied

<small>2024-11-21 20:36:47:</small> Failed to create folder root directory stat /home/<username>/Roam: permission denied

<small>2024-11-21 20:36:47:</small> Error on folder "Roam" (etuex-azy25): stat /home/<username>/Roam: permission denied

OK

My questions are:

  1. Why am I getting this?
  2. Is this because I am running as a system service and not as my user?
  3. How can I get around this?

Does the user that owns the Syncthing process (I have never touched your OS) have rights to the directory?

Also, do I understand correctly that <username> is a replacement you made to protect the privacy of the username?

(Multiple edits to correct and clarify.)

I attempted to ‘chmod 755’ it but that didn’t work.

Also you’re right about my username :slight_smile:

1 Like

Just for testing, please “su” to the user that owns the Syncthing process, and see if you can write a file in that directory.

To be honest I don’t even know the credentials for this syncthing user.

I didn’t create the user syncthing. I think it was started automatically when I enabled the system service in my configuration.nix

sudo su syncthing

…should work, if your user is in the sudoers file.

Thanks for your help btw. I realize I’m just a bit dumb and was running it as a system service where I should have been running it as a user service.

For nixos this requires loading it as a home-manager module which I did and all was well.

Thanks :slight_smile:

1 Like

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