CentOS7.4 安装配置流程

教程理论上适用于任何CentOS7.*系统

tips:步骤2适用于国内用户

1.CentOS安装初始化

安装工具查看ip

yum install net-tools -y

查看ip并使用xshell等工具连接Centos

ifconfig -a
vi /etc/ssh/sshd_config

修改以下内容,将前面的#号去掉即可(按i进入编辑模式,按esc然后输入:wq保存并退出)

Port 22
ListenAddress 0.0.0.0
ListenAddress ::
ermitEmptyPasswords no
PasswordAuthentication yes

重启ssh服务

systemctl restart sshd.service

设置ssh开机启动

systemctl enable sshd.service

ssh端口放开防火墙

firewall-cmd --permanent --zone=public --add-port=22/tcp

重载防火墙配置

firewall-cmd --reload

安装wget

yum install wget -y

2.国内源配置(国外用户可忽略此步骤)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

缓存源

yum makecache

国内源配置完毕