源/软件/时区/selinux/ulimit/vim/sshd
下载安装:
https://mirrors.aliyun.com/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso
也可以使用搜狐或者网易的源
https://mirrors.163.com/
https://mirrors.sohu.com/
yum install wget -y
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum install lrzsz ntpdate sysstat dos2unix wget telnet tree htop iftop iotop bridge-utils net-tools bind-utils openssl-devel vim nc stress curl bash-com* unzip python-netaddr git tcpdump jq lsof strace ntsysv sysstat psmisc -y
rm -rf /etc/localtime && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && ntpdate ntp1.aliyun.com
echo '*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >/dev/null 2 >&1' >>/var/spool/cron/root
systemctl enable ntpdate && systemctl start ntpdate
sudo systemctl disable firewalld postfix NetworkManager
sudo systemctl stop firewalld postfix NetworkManager
sysctl -w vm.max_map_count=262144
sysctl -p
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
getenforce
ulimit -SHn 65535
echo '* - nofile 65536' >>/etc/security/limits.conf
cat >>/etc/vimrc<<EOF
set nu
set cursorline
set nobackup
set ruler
set autoindent
set vb t_vb=
set ts=4
set expandtab
set paste
EOF
. /etc/vimrc
\cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ori
sed -i 's#\#UseDNS yes#UseDNS no#g' /etc/ssh/sshd_config
sed -i 's#GSSAPIAuthentication yes#GSSAPIAuthentication no#g' /etc/ssh/sshd_config
sed -i 's#\#AddressFamily any#AddressFamily inet#g' /etc/ssh/sshd_config下载安装:
https:/