Menu Home

sudo环境变量设置

编辑 /etc/sudoers :

Defaults   env_reset
Defaults   secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

修改为:

#不重置sudo的环境变量,沿用当前用户的环境变量
Defaults    !env_reset
#Defaults   secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Leave a Reply

Your email address will not be published.