这篇文章上次修改于 200 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

1.修改网络配置

设置静态IP,方便远程
[[email protected] ~]# 

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

ONBOOT="yes"
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="8.8.8.8"
DNS2="88.88.88.88"

[[email protected] ~]# 重启网络服务

service network restart

2.安装网络工具

[[email protected] ~]# 

yum -y install net-tools

3.安装常用工具

[[email protected] ~]# 

yum -y install curl telnet vim wget lrzsz

4.配置阿里yum源

[[email protected] ~]# 备份原yum源 

mkdir ~/backups/yum.repos.d

                                                           
[[email protected] ~]# 

mv /etc/yum.repos.d/* ~/backups/yum.repos.d

[[email protected] ~]# 

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

[[email protected] ~]# 

yum clean all

[[email protected] ~]# 

yum makecache

[[email protected] ~]# 列出可用包进行验证 

yum list 

5.配置SSH远程连接服务

[[email protected] ~]# 

yum install -y openssh-server

[[email protected] ~]# 

sudo systemctl enable sshd

[[email protected] ~]# 

sudo systemctl start sshd

[[email protected] ~]#  配置防火墙端口开放策略

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

[[email protected] ~]#  刷新防火墙

sudo service firewalld restart  

————————————————
版权声明:本文为CSDN博主「ShawYore」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/IAGod/article/details/88815209

1