Permalink
Browse files

+ Do not reset enviroment variables while sudo.

  • Loading branch information...
1 parent fe6815c commit fe31e7994c4936ae38db173d19e82101f9c78da2 @leopku leopku committed Jul 11, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 centostweak.sh
View
3 centostweak.sh
@@ -152,6 +152,7 @@ yum install sysstat ntp net-snmp sudo screen -y
cp /etc/sudoers /etc/sudoers.`date +"%Y-%m-%d_%H-%M-%S"`
# 允许wheel组的系统用户通过无密码sudo方式行使root权限
sed -i -e '/NOPASSWD/s/^# //' /etc/sudoers
+sed -i -e 's/env_reset/!env_reset/' /etc/sudoers
# 添加环境变量,保证sudo时不用绝对路径执行常用管理命令以及编译软件时能找到库文件
echo 'export PATH=$PATH:/sbin:/usr/sbin' >> /etc/bashrc
echo 'export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"' >> /etc/bashrc
@@ -308,4 +309,4 @@ sed -i '/# End of file/i\*\t\t-\tnofile\t\t65535' /etc/security/limits.conf
# yum install -y fail2ban
# cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.conf.`date +"%Y-%m-%d_%H-%M-%S"`
# sed -i 's/bantime = 600/bantime = 43200/' /etc/fail2ban/jail.conf
-# ${SERVICE} fail2ban start
+# ${SERVICE} fail2ban start

0 comments on commit fe31e79

Please sign in to comment.