Centos7
前言
重装Centos系统后,需要进行的一些操作。
一、环境初始化
iptables -F 清空防火墙规则
systemctl disable firewalld 关闭防火墙 禁止开机自启
systemctl stop firewalld 停止防火墙服务
getenforce
输出 Disabled
如果不是 就输入 vim /etc/selinux/config 将 SELINUX=disabled
二、配置yum源 阿里云 以及 epel源 方法
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all 清空原有yum源头
yum makecache 生成新的yum缓存,便于加速软件下载
三、安装系统初始化所需要的软件
yum install -y bash-completion vim lrzsz wget expect net-tools nc nmap tree dos2unix htop iftop iotop unzip telnet sl psmisc nethogs glances bc ntpdate openldap-devel gcc
四、修改系统字符集
localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf 写入配置文件 永久生效
locale 检查系统字符集
输出:
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=