- 论坛徽章:
- 39
|
回复 24# lsstarboy
感谢.看了下`man sudoers`,找到了原因.确实默然是`env_reset`这个的原因- Command environment
- Since environment variables can influence program behavior, sudoers pro‐
- vides a means to restrict which variables from the user's environment are
- inherited by the command to be run. There are two distinct ways sudoers
- can deal with environment variables.
- By default, the env_reset option is enabled. This causes commands to be
- executed with a new, minimal environment. On AIX (and Linux systems
- without PAM), the environment is initialized with the contents of the
- /etc/environment file. The new environment contains the TERM, PATH,
- HOME, MAIL, SHELL, LOGNAME, USER, USERNAME and SUDO_* variables in addi‐
- tion to variables from the invoking process permitted by the env_check
- and env_keep options. This is effectively a whitelist for environment
- variables.
复制代码 |
|