This article suggests using “sudo sh”, which basically creates shell, and executes multiple commands.
Is there any creative way of executing commands using “sudo”, without opting for new shell or without using “sh”.
There are some statements in sudoers man page (man 5 sudoers), can anyone please explain these statements?
“If sudo is run by root and the SUDO_USER environment variable is set, the sudoers policy will use this value to determine who the actual user is. This can be used by a user to log
commands through sudo even when a root shell has been invoked. It also allows the -e option to remain useful even when invoked via a sudo-run script or program. Note, however,
that the sudoers lookup is still done for root, not the user specified by SUDO_USER.”