Well. I know that OpenWRT is supposed to work only under root, and has build-in security system. So may be I do not need sudo and different users. Or, may be I must enable it if I, for example, want to start lighthhtpd server?
No, Openwrt admin always runs as a root user so every app or package you execute is run at the highest privileges. If lighthhtpd
doesn't work then is a package issue.
No ... not when building from src anyway.
I could be wrong but I believe when using the image-builder, sudo is required ?? I can't say for certain because I never use it.
No, you never compile as root user. And no, the image build does also not require to be root.
learned something new today ..ty
I only use full build system, i have never used openwrt image-builder or sdk, i thought i remembered it being mentioned somewhere that sudo was required for the builder, i think what was actually mentioned, was not to used sudo i was just too lazy to search for it first
Lighty creates its own user with very limited rights, it does not run as root.
This is just fine until you use something like php with lighty. Then, depending on what you are trying to do, you might need to install the sudo package.
For example if you want to exec an external command, lighty will call the external command as its own user, so the php would look something like this:
$cmd="sudo /sbin/uci get network.wanb.macaddr";
$macwanb=exec($cmd);
Many thanks, guys! You cleared my mind!