阿里云源(可选)
CentOS7和epel-7
1 | wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo |
关闭selinux
1 | sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config |
配置最大文件打开数和用户最大进程数
1 | echo -ne " |
ssh优化
1 | sed -i -e 's/#Port 22/Port 2012/' /etc/ssh/sshd_config |
停用自带防火墙
1 | systemctl stop firewalld |
安装常用工具(可选)
1 | yum install net-tools lrzsz lsof telnet wget nmap dos2unix screen tcpdump vim sysstat bind-utils ntpdate -y |
命令历史记录(可选)
1 | cat >> /etc/profile <<'EOF' |
安装iptables防火墙(可选)
1 | yum install iptables-services |