Answer the question
In order to leave comments, you need to log in
What needs to be configured to not prescribe sudo for system commands?
Please clarify the following situation: the system command requires sudo even from the superuser. how so?
$ iptables
bash: iptables command not found
$ sudo iptables
-- works
$ su
# whoami
root
#iptables
bash: iptables command not found
# sudo iptables
-- works
Answer the question
In order to leave comments, you need to log in
in general, it was necessary to read mana :)
here is a good article - the answer to my question.
https://www.kubuntu.ru/node/10964
The correct answer is that for sudo with no arguments, the PATH variable is hardcoded
* sudo by default does not use the PATH from your user or from root
* sudo also ignores global variables from /etc/environment or /etc/profile.d/*.sh .
* PATH for sudo is hardcoded to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
If needed make your PATH in sudo, you can either do this: " sudo bash " and already in the open bash set up PATH or other variables.
Or you can write what you need to the global config /etc/profile.d/name_anything.sh using export, and run
For reference, you can read man sudo, look for env_reset
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question