Integrated architecture _ before optimization

# Vi following information to 123.sh to run in sh 123.sh
# 1 source for the optimization yum Ali cloud mirroring
curl -o /etc/yum.repos.d/CentOS-Base.repo http: // mirrors. aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# download commonly used software
yum install - y vim wget net-tools telnet bash -completion bash-completion-extras tree lrzsz htop ntpdate

# Turn off the firewall
systemctl STOP firewalld.service
systemctl disable firewalld.service

# Temporary and permanent closing SELinux
the setenforce 0
Sed -i 'S = enforcing the SELINUX # # # Disabled the SELINUX = G'

# Highlight command line (optional)
echo "
Export PS1 = '\ [\ E [32; 1M \] [\ [\ E [0m \] \ [\ E [35; 1M \] \ U \ [\ e [0m \] \ [\ e [31; 1m \] @ \ [\ e [0m \] \ [\ e [36; 1m \] \ h \ [\ e [0m \] \ W \ [\ e [32; 1m \]] \ [\ e [0m \] \ [\ e [34; 1m \] \ $ \ [\ e [0m \] ' ">> / etc / profile

# Close the mail server (optional)
systemctl STOP postfix
systemctl disable postfix

# Host resolution (optional)
CAT >> / etc / hosts << EOF
172.16.1.81 firewalld
172.16.1.5 LB01
172.16.1.6 LB02
172.16.1.7 web01
172.16.1.8 web02
172.16.1.9 web03
172.16.1.51 DB01
172.16.1.31 nfs01
172.16 Backup .1.41
172.16.1.61 M01
172.16.1.71 zabbix
EOF

# Update time of (optional)
echo "update time of #
* / 5 * * * * / usr / sbin / ntpdate ntp1.aliyun.com &> dev / null" >> / var / spool / cron / root

#ssh优化(可选)
sed -i 's#GSSAPIAuthentication yes#GSSAPIAuthentication no#g' /etc/ssh/sshd_config
sed -i 's#\#UseDNS yes#UseDNS no#g' /etc/ssh/sshd_config

# Delete UUID HWADDR (just remove the existing card UUID)
sed -ri '/ UUID | HWADDR / d' / etc / sysconfig / Network-scripts / the ifcfg-eth [01]

# A button to change the host name in other scripts (this feature is temporarily open)
#mkdir -p / Server / scripts
#cat >> / etc / hosts << EOF
# "#! / Bin / bash
#NAME = \ $ 1
#ip = \ 2 $
#
## configuration parameter limit
#if [$ # -ne 2]
#then
#echo 'you do not enter the two parameters'
#exit
#fi
#
## to modify the host name
#hostnamectl hostname SET-name $
#
## modify the network card address
#sed -i "S $ # IP # G # 200 is" / etc / sysconfig / Network-scripts / the ifcfg-Eth [01] "> /server/scripts/init.sh
#EOF

Guess you like

Origin www.cnblogs.com/zhanghongqi/p/11886238.html