几个比较常用的配置
一、关闭防火墙
1.临时关闭防火墙,重启系统失效
systemctl stop firewalld
2.永久关闭防火墙,重启系统生效
systemctl disable firewalld
二、关闭selinux
1.临时关闭selinux,重启系统失效
setenforce 0
2.永久关闭防火墙和selinux,重启系统生效
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
三、安装基本软件
1.安装vim编辑器、net-tools工具包、wget下载工具、lrzsz文件传输工具
yum install -y vim net-tools wget lrzsz
2.其它软件选择安装
yum install -y unzip elinks lsof dos2unix
四、配置yum源
1.备份自带yum源
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
2.下载阿里云的base源,没有wget命令会无法下载
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3.下载阿里云的epel源,看需求
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4.清除旧缓存,生成新缓存
yum clean all && yum makecache
五、修改主机名
1.临时改名,node为改的名字,重启失效
hostname node
bash
2.永久改名,重启也生效
hostnamectl set-hostname node
bash