I've been using qbittorrent-nox on a headless Raspberry Pi 3 B+. The setup was a breeze. But then I wanted to autostart qbittorrent after boot, so I wrote a systemd service unit and enabled it. It worked and the service started on boot. But it was started with root previleges. Is there any way to do this as another non-root user?

  • 4
    You can specify the directives User= and Group= in the [Service] section of the unit file. - as found using google – Jaromanda X Jan 1 '19 at 8:54
  • @Jaromanda You should post that below as an answer so the OP can mark this as resolved (and you can claim some rep, too) – Aurora0001 Jan 1 '19 at 13:17
  • @JaromandaX Wow, that was simple. Silly of me. – sixter Jan 2 '19 at 11:46
  • Look at man systemd.exec. – Ingo Jan 3 '19 at 11:04

You can include

[Service] ... User=pi Group=pi ...

in your service file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.