Yes, and I had the same result when I was playing around. My comment was SUDO looks on a different path since it doesn't find the executable.Not on RPiOS it doesn't. Both echo $PATH and sudo echo $PATH return the same thing. In my case that's /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Only if the system security policy is configured to modify the inherited $PATH. And if that were the case I'd expect it to be reflected in the output from sudo echo $PATH.
We don't know what OS the OP is running. Nor do we know now it has been configured or if they actually have admin/sudo rights or are trying to hack them. The fact they appear to be trying to run visudo from a user directory suggests that they are.
Statistics: Posted by thagrol — Tue Jan 07, 2025 11:33 pm