Answer the question
In order to leave comments, you need to log in
Why does a sudo script work fine but not as root? How is this possible?
There is one sh script. And he requires root rights. Works fine through sudo, but if you run the script as root, then a couple of errors fly out in the process. And I can't understand how this is possible, because sudo and root must have the same rights. What could be the reason in theory?
The script does not execute rename and\or rpl commands, which is why it does not find the necessary paths for files later, and everything is fucked up. But everything works through sudo.
What's the magic? It seems to me some kind of chroot jail on the servers, something is blocking the external. I can't find any other explanation.
Tell me, otherwise I'll go crazy.
Answer the question
In order to leave comments, you need to log in
sudo - execute a command on behalf of another user,
but the root environment variables are superimposed on the current ones.
If you log in as root, you may be missing something in PATH or in some other necessary variable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question