# Running Syncthing as root?

**URL:** https://forum.syncthing.net/t/running-syncthing-as-root/6316
**Category:** General
**Created:** [December 3, 2015, 1:34pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316 "2015-12-03T13:34:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![stone](https://forum.syncthing.net/user_avatar/forum.syncthing.net/stone/32/17579_2.png) [@stone](https://forum.syncthing.net/u/stone)
#### Post date: [December 3, 2015, 1:34pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/1 "2015-12-03T13:34:57Z")

</div>

Hi,

There is any argument against running Syncthing as root? Someone asked me this, who wants to synchronize files of several websites/users between servers.

Cheers

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [December 3, 2015, 1:40pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/2 "2015-12-03T13:40:59Z")

</div>

Yes. If something goes wrong (someone manages to access the web UI, or a config file, for example), then they can control a program which is specifically designed for reading and writing files, running with root permissions. They can use this to read/write any file on the filesystem, and completely own you.

It’s the same argument against running _any_ process as root unless it really _really_ needs to. Except more extreme, because Syncthing is designed for reading and writing files: you don’t need to even try hard to convince it to read `/etc/shadow`.

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [December 3, 2015, 2:22pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/3 "2015-12-03T14:22:52Z")

</div>

> [@stone](#):
>
> who wants to synchronize files of several websites/users

Syncthing will always create files/folders with the user and group with which it is run. So running as root will create files owned by root.

---

<div class="post-metadata">

### Author: ![stone](https://forum.syncthing.net/user_avatar/forum.syncthing.net/stone/32/17579_2.png) [@stone](https://forum.syncthing.net/u/stone)
#### Post date: [December 3, 2015, 2:38pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/4 "2015-12-03T14:38:11Z")

</div>

Thanks for the answers.

I know that running anything as root is risky, but sometimes you can’t avoid it. But the main point of that Syncthing is not designed for it what @wweich told that it will create files as root so not preserving ownership.

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [December 3, 2015, 2:44pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/5 "2015-12-03T14:44:23Z")

</div>

You can probably do what you want by using ACLs, which will also let you run Syncthing as an unprivileged user. For example, I have syncthing running on my server as the `syncthing` user, while a web server, running as `http`, can access specific files of syncthing’s.

---

<div class="post-metadata">

### Author: ![stone](https://forum.syncthing.net/user_avatar/forum.syncthing.net/stone/32/17579_2.png) [@stone](https://forum.syncthing.net/u/stone)
#### Post date: [December 3, 2015, 2:57pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/6 "2015-12-03T14:57:59Z")

</div>

Nice idea.

---

<div class="post-metadata">

### Author: ![lfam](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/l/ea666f/32.png) [@lfam](https://forum.syncthing.net/u/lfam)
#### Post date: [December 3, 2015, 7:09pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/7 "2015-12-03T19:09:38Z")

</div>

Why can’t you set up one Syncthing process per user? That is the intended method of operation.

---

<div class="post-metadata">

### Author: ![stone](https://forum.syncthing.net/user_avatar/forum.syncthing.net/stone/32/17579_2.png) [@stone](https://forum.syncthing.net/u/stone)
#### Post date: [December 3, 2015, 7:23pm UTC](https://forum.syncthing.net/t/running-syncthing-as-root/6316/8 "2015-12-03T19:23:02Z")

</div>

There are 30+ users, but don’t mind we try with glusterfs, Syncthing was just an idea.
