V
V
Vyacheslav Shevchenko2021-02-25 16:53:08
linux
Vyacheslav Shevchenko, 2021-02-25 16:53:08

How to run a daemon as a non-root user?

There is a sphinx daemon that runs as the root user, you need to run it as a separate user. How can I do that?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2021-02-26
@WebDev2030

For starters, Linux is a lot. Specify in which file the launch of the daemon is described, in fact, the file itself can be thrown.
In the old init.d, most likely just via runuser or su
in the new one declaratively in the unit file
[Service]
User=anotheruser
Group=anothergroup

R
Ruslan Fedoseev, 2021-02-25
@martin74ua

specify in its settings under which user it should work

T
Talyan, 2021-02-25
@flapflapjack

It is possible with a cron, because /etc/crontab specifies the username on whose behalf to run the command.
here - how to run as another user from the console,
here how to run from the console using sudo with editing /etc/sudoers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question