I need execute script that have commands which should be run in root mode.
If I put sudo before command then when I run script I see permission denied ( I don't have a chance to write password).
If I run script with sudo then it writes - command not found.
If I put sudo su in the beginning of the script then after I inter password nothing happens. Script executes only when exit root mode.
How can make such script? Thank you.
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
|||
|
|
|
You can set a script to not require a password via sudo with e.g. the following in
|
|||||
|
|
(Posted as a new answer since I can't comment & the edit is too small) You can end the command with
Now |
|||
|
|