Skip to content

Commit

Permalink
+ Do not reset enviroment variables while sudo.
Browse files Browse the repository at this point in the history
  • Loading branch information
leopku committed Jul 11, 2011
1 parent fe6815c commit fe31e79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion centostweak.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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.