B
B
bychok3002017-03-14 13:34:10
System administration
bychok300, 2017-03-14 13:34:10

How to give a file root executable permissions in Ubuntu 16.04?

There is a script that should create files when the computer is turned on. It seems that I did everything, but I can’t catch up with how to give root rights to the script so that it can start from startup without asking for a password.
did chown root:root /path.to/script/some.sh
wrote in sudoers:

me   ALL=(ALL) NOPASSWD: /home/me/Desktop/logCreator.sh

and so did
# Cmnd alias specification
Cmnd_Alias sh = /home/me/Desktop/sh.sh
в конце файла :
me ALL=(ALL) NOPASSWD: sh

after that sudo was unavailable due to an error in Cmnd Alias
​​what to do? how to give rights?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xibir, 2017-03-14
@bychok300

in sudoers write
me ALL=NOPASSWD: /path.to/script/some.sh
run
sudo /path.to/script/some.sh

V
Vasily, 2017-03-14
@DobriyJuk

chmod +x /home/me/Desktop/sh.sh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question