sudo ENV_KEEP not always preserving
- by mafro
When I run sudo -s, my environment is preserved. However, when running a simple sudo <command> it appears not to be preserved.
The contents of my sudoers file:
mafro@ip-10-xx-xx-250:~ > sudo cat /etc/sudoers.d/mafro
Defaults env_reset
Defaults env_keep += "HOME"
mafro ALL=(ALL) NOPASSWD:ALL
Using sudo -s, the ll alias is available:
mafro@ip-10-xx-xx-250:~ > sudo -s
root@ip-10-xx-xx-250:~ > ll
total 8K
drwxrwxr-x 2 mafro dev 4.0K Jun 9 23:59 bin
drwxr-xr-x 20 mafro dev 4.0K Jun 9 23:59 dotfiles
Using straight sudo, it is not:
mafro@ip-10-xx-xx-250:~ > sudo ll
sudo: ll: command not found
What is happening here?