# Syncthing / permissions — Create a share with existing folder

**URL:** https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265
**Category:** Support apps
**Tags:** english
**Created:** [June 25, 2019, 10:14am UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265 "2019-06-25T10:14:24Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [June 25, 2019, 10:14am UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/1 "2019-06-25T10:14:24Z")

</div>

### My YunoHost server

**Hardware:** Kimsufi KS4  
**YunoHost version:** 3.5.2.2

### Description of my issue

Hello everyone,

I’d like to add a share to the app Syncthing, using a user folder, or a Yunohost backup folder.

For example:

```auto
/home/yunohost.multimedia/$user
/home/yunohost.backup/archives/

```

I’ve got those errors:

```auto
2019-06-25 12:10:25: Loading ignores: open /home/yunohost.backup/archives/.stignore: permission denied
2019-06-25 12:10:25: Failed to create folder marker: stat /home/yunohost.backup/archives/.stfolder: permission denied
2019-06-25 12:10:25: Error on folder "Backup archives" (kyp6f-nwaxw): stat /home/yunohost.backup/archives/.stfolder: permission denied 

```

Can you please tell me what permissions I need to change exactly?

THANKS 🙂

---

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [June 25, 2019, 3:43pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/2 "2019-06-25T15:43:30Z")

</div>

I’ve try to add the user `syncthing` to the group `multimedia`, with little hope, but no difference.  
I think I could add the user `syncthing` to the group `root`, but it does not seems right.

I’ll wait for your feedback before breaking anything.

---

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [June 27, 2019, 10:15am UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/3 "2019-06-27T10:15:57Z")

</div>

Solved!

```auto
setfacl -Rm user:syncthing:rwx /home/yunohost.multimedia/thomas

```

---

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [June 29, 2019, 9:52am UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/4 "2019-06-29T09:52:50Z")

</div>

Well, it’s not working after all.

- Syncthing can r/w on the Multimedia folder
- But now Nextcloud can not w on the folder creating by Syncthing…

When Syncthing create a folder:

```auto
# file: FolderCreatedBySyncthing                                                                                                                                  
# owner: syncthing                                                                                                                                   
# group: syncthing 

```

So Nextcloud can’t write in it.  
BUT this folder is also:

```auto
# file: FolderCreatedBySyncthing                                                                                                                                   
# owner: syncthing                                                                                                                                   
# group: syncthing                                                                                                                                   
user::rwx                                                                                                                                            
user:syncthing:rwx                                                                                                                                   
user:nextcloud:rwx
user:www-data:rwx

```

So why Nextcloud can’t r/w ?  
This is sooo difficult! But I will make it, sometime.  
Thanks!

---

<div class="post-metadata">

### Author: ![Jan.DEV-CORPS](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Jan.DEV-CORPS](https://forum.yunohost.org/u/Jan.DEV-CORPS)
#### Post date: [January 28, 2020, 5:37pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/5 "2020-01-28T17:37:31Z")

</div>

Have you found a solution to the problem?  
I’m facing the exact same problem.

---

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [January 28, 2020, 6:48pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/6 "2020-01-28T18:48:43Z")

</div>

Sorry but no. I gave up using Syncthing. But I never really learned Linux permissions and I should. Nevertheless this is really not user-friendly.

---

<div class="post-metadata">

### Author: ![Jan.DEV-CORPS](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Jan.DEV-CORPS](https://forum.yunohost.org/u/Jan.DEV-CORPS)
#### Post date: [January 28, 2020, 7:26pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/7 "2020-01-28T19:26:14Z")

</div>

I have found the solution. In your case it would be something like this  
`setfacl -Rmb g:groupName:rwX,d:g:groupName:rwX,u:userName:rwX,d:u:userName:rwX /home/yunohost.multimedia/thomas`

But it’s unfortunate that you gave up using Syncthing I’m enjoing it by now. Yeah I give you the point that it takes somtime to get used to it.

And another hint for you: I created an extra group on the server just for folders that mulitple users have read/write access to it.

---

<div class="post-metadata">

### Author: ![isidoreisou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@isidoreisou](https://forum.yunohost.org/u/isidoreisou)
#### Post date: [January 29, 2020, 8:50am UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/8 "2020-01-29T08:50:20Z")

</div>

Thanks a lot for this, it will helps me in th future for sure!

---

<div class="post-metadata">

### Author: ![mateMatt](https://forum.yunohost.org/user_avatar/forum.yunohost.org/matematt/32/8598_2.png) [@mateMatt](https://forum.yunohost.org/u/mateMatt)
#### Post date: [April 3, 2022, 2:09pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/9 "2022-04-03T14:09:40Z")

</div>

Hi @Jan.DEV-CORPS ,

Have you been able to enjoy syncthing with no problem since then?  
I am trying to use the /home/yunohost.multimedia/share folder to create a shared file zone that is shared among the users.  
I am very new to the ACL file permissions, so I looked at the man page to understand better.  
So here where I ended up:

```auto
$ id syncthing
uid=993(syncthing) gid=993(syncthing) groups=993(syncthing)
$ sudo setfacl -Rmb g:syncthing:rwX,d:g:syncthing:rwX,u:syncthing:rwX,d:u:syncthing:rwX /home/yunohost.multimedia/share/
setfacl: Option -m: Invalid argument near character 
$ sudo setfacl -Rb g:syncthing:rwX,d:g:syncthing:rwX,u:syncthing:rwX,d:u:syncthing:rwX /home/yunohost.multimedia/share/
setfacl: g:syncthing:rwX,d:g:syncthing:rwX,u:syncthing:rwX,d:u:syncthing:rwX: No such file or directory

```

I don’t see any particular change int he behavior, any help would be very welcome.

---

<div class="post-metadata">

### Author: ![mateMatt](https://forum.yunohost.org/user_avatar/forum.yunohost.org/matematt/32/8598_2.png) [@mateMatt](https://forum.yunohost.org/u/mateMatt)
#### Post date: [April 3, 2022, 5:35pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/10 "2022-04-03T17:35:30Z")

</div>

I am not sure what I have done is the proper way of doing it, but here is what I found to be functional.  
The basic idea is to adapt the group members to allow the modifications by nextcloud, syncthing, and later any other program of file sharing.

```auto
$ sudo nano /etc/group

```

add to multimedia:x:1000:nextcloud,nextcloud\_\_2

```auto
,syncthing,users,www-data

```

Save (Ctrl+o), exit (Ctrl+x), then use

```auto
$ sudo chown -R www-data:multimedia /home/yunohost.multimedia/share

```

This made the job for me, then you have your shared files in this folder for all users to use.

---

<div class="post-metadata">

### Author: ![blodarn](https://forum.yunohost.org/user_avatar/forum.yunohost.org/blodarn/32/4072_2.png) [@blodarn](https://forum.yunohost.org/u/blodarn)
#### Post date: [November 1, 2024, 8:24pm UTC](https://forum.yunohost.org/t/syncthing-permissions-create-a-share-with-existing-folder/8265/11 "2024-11-01T20:24:21Z")

</div>

Hi @mateMatt @isidoreisou @RaspYuno @gabjy !

I think I found a solution. It worked for me.  
Connect to the server in command line (CLI) : [SSH and command line | Yunohost Documentation](https://yunohost.org/en/ssh)

Apply those commands (change the path according to your needs) :

```auto
sudo setfacl -R -m u:syncthing:rwX /home/yunohost.backup/archives
sudo setfacl -R -m d:u:syncthing:rwX /home/yunohost.backup/archives
sudo setfacl -R -m u:syncthing:rwX /home/yunohost.multimedia/admin/eBook
sudo setfacl -R -m d:u:syncthing:rwX /home/yunohost.multimedia/admin/eBook

```

Verify that the permissions were changed with commands below :

```auto
getfacl /home/yunohost.multimedia/admin/eBook

    getfacl: Removing leading '/' from absolute path names
    # file: home/yunohost.multimedia/admin/eBook
    # owner: admin
    # group: root
    user::rwx
    user:syncthing:rwx
    group::rwx
    group:multimedia:rwx
    mask::rwx
    other::r-x
    default:user::rwx
    default:user:syncthing:rwx
    default:group::rwx
    default:group:multimedia:rwx
    default:mask::rwx
    default:other::r-x

getfacl /home/yunohost.backup/archives

    getfacl: Removing leading '/' from absolute path names
    # file: home/yunohost.backup/archives
    # owner: root
    # group: admins
    user::rwx
    user:syncthing:rwx
    group::rwx
    mask::rwx
    other::---
    default:user::rwx
    default:user:syncthing:rwx
    default:group::rwx
    default:mask::rwx
    default:other::---

```

Then to allow syncthing to traverse these directories without altering existing permissions, you can add execute permissions specifically for the syncthing user using ACLs.

```auto
For /home/yunohost.backup:
sudo setfacl -m u:syncthing:x /home/yunohost.backup

For /home/yunohost.multimedia:
sudo setfacl -m u:syncthing:x /home/yunohost.multimedia

For /home/yunohost.multimedia/admin:
sudo setfacl -m u:syncthing:x /home/yunohost.multimedia/admin

```

😉
