Centos7 Minimal最小安装后要进行的优化
1.修改网络配置
设置静态IP,方便远程
[root@localhost ~]#
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"
[root@localhost ~]# 重启网络服务
service network restart
2.安装网络工具
[root@localhost ~]#
yum -y install net-tools
3.安装常用工具
[root@localhost ~]#
yum -y install curl telnet vim wget lrzsz
4.配置阿里yum源
[root@localhost ~]# 备份原yum源
mkdir ~/backups/yum.repos.d
[root@localhost ~]#
mv /etc/yum.repos.d/* ~/backups/yum.repos.d
[root@localhost ~]#
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]#
yum clean all
[root@localhost ~]#
yum makecache
[root@localhost ~]# 列出可用包进行验证
yum list
5.配置SSH远程连接服务
[root@localhost ~]#
yum install -y openssh-server
[root@localhost ~]#
sudo systemctl enable sshd
[root@localhost ~]#
sudo systemctl start sshd
[root@localhost ~]# 配置防火墙端口开放策略
sudo firewall-cmd --zone=public --add-port=22/tcp --permanent
[root@localhost ~]# 刷新防火墙
sudo service firewalld restart
————————————————
版权声明:本文为CSDN博主「ShawYore」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/IAGod/article/details/88815209