#! /bin/bash
if [ $user != "root"]
then
echo "Scripts that require sudo to use"]
exit 1
fi
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
cd /usr/local/src
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
cd /etc/yum.repo.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
cp /usr/local/src/CentOS6-Base-163.repo ./CentOS-Base.repo
yum clean all #Clear cache information
yum makecache #Regenerate the cache
yum update -y #Upgrade the system and its installation package
cd /usr/local/src
wget http://d1.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install gcc gcc-c++ vim-enhanced unzip unrar sysstat
yum install -y setuptool setup's main toolkit
yum install -y system-config-network-tui setup supporting network card setup toolkit
yum install -y iptables system-config-securitylevel-tui setup supporting firewall toolkit
yum install --y bash-completion-20090212-1mdv2009.1.noarch command completion toolkit
yum install --y tree.x86_64 tree display directory structure
yum -y install ntp
echo "01 01 * * * /usr/sbin/ntpdate ntp.api.bz >> /dev/null 2>&1" >> /etc/crontab
/usr/sbin/ntpdate ntp.api.bz
service crond restart
for i in chkconfig --list | grep 3:on |awk -F " " '{print $1}'
do
/sbin/chkconfig --level 3 $i off
done
for a in {crond,network,rsyslog,sshd,sysstat}
do
/sbin/chkconfig --level 3 $a on
done
cat >>/root/.vimrc<<EOF
set number #display with line number
set ruler
set nohlsearch
set shiftwidth=2
set tabstop=4 #tab is 4 spaces
set expandtab
set cindent
set autoindent #Automatic alignment
set mouse=v
syntax on
EOF
echo “” > /etc/issue
echo "export HISTSIZE=500" >>/etc/profile
echo “export HISTFILE=/dev/null” >>/etc/profile
echo “export HISTFILESIZE=50” >> /etc/profile
echo “export TIMEOUT=300” >>/etc/profile
source /etc/profile
reboot
Unfinished
I hope you can give me more advice and join a group of 764640548 to learn and make progress together! ! ! ! ! ! ! ! ! !
Recommended Posts