1. 创建虚拟机
2. 配置网卡
在界面中按TAB输入
net.ifnames=0 biosdevname=0
回车 开始安装
优化配置yum源
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' -i.bak /etc/yum.repos.d/CentOS-*.repo
sudo yum install epel-release -y
sudo sed -e 's!^metalink=!#metalink=!g' -e 's!^#baseurl=!baseurl=!g' -e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' -e 's!https\?://download\.example/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' -i /etc/yum.repos.d/epel*.repo
下载常用软件
yum install -y vim wget tree telnet nc nmap net-tools bash-completion #(补全参数软件)
系统安全优化
1.firewalld(防火墙)
systemctl stop firewalld.service #关闭firewalld防火墙服务
systemctl status firewalld.service #关闭开机启动firewalld防火墙服务
2.selinux (限制root用户行为)
vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing #开启
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# 重启后生效