Why do I not have sufficient permission when running sudo as a user
sudo -u chris
runs the given command as user chris
, not as root with USER
set to chris
. So if chris
can’t access /root
, sudo -u chris
won’t change that.
See man sudo
:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
sudo
isn’t specifically a “run as root” tool; it’s a “run as some other user or group” tool.