L
L
LVitA2018-04-28 18:50:46
linux
LVitA, 2018-04-28 18:50:46

How to run commands with admin rights on Linux startup?

Good day!
You need to run a couple of programs at startup, but they only run as administrator. How to make it so that the command to run as administrator is executed at system startup?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Savinov, 2018-04-28
@LVitA

add them to /etc/rc.local

O
OnYourLips, 2018-04-28
@OnYourLips

The best way is to create a systemd unit with Type=simple.
A bonus is convenient logging and management.
Example at the link:
https://www.devdungeon.com/content/creating-system...

A
Alexander Chernykh, 2018-04-28
@sashkets

deal with crontab for root, @reboot option

R
Reversaidx, 2018-04-29
@Reversaidx

I would add commands to the /etc/rc.local file, in which the commands are executed every time the system boots (line by line)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question