我是靠谱客的博主 细心酒窝,最近开发中收集的这篇文章主要介绍CentOS 8.0 基本配置,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1. 修改主机名

 

[root@localhost ~]# hostname
localhost.localdomain

 

[root@localhost ~]# vi /etc/hostname                     //将文件中的“localhost.localdomain”修改为“Server”,需重启后方可生效
localhost.localdomain  ->   Server

2. 关闭selinux

 

[root@localhost ~]# vi /etc/selinux/config               // 将文件中的“SELINUX=enforcing”修改成“SELINUX=disabled”,需重启后方可生效

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

3. 关闭防火墙并禁止开机自启动

 

[root@localhost ~]# systemctl stop firewalld.service                   //停止防火墙服务

 

[root@localhost ~]# systemctl disable firewalld.service                   //禁止防火墙服务开机自启动
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

4. 更新系统软件

 

[root@localhost ~]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.18.0-5.el7 will be updated
---> Package NetworkManager.x86_64 1:1.18.0-5.el7_7.1 will be an update
---> Package NetworkManager-adsl.x86_64 1:1.18.0-5.el7 will be updated
---> Package NetworkManager-adsl.x86_64 1:1.18.0-5.el7_7.1 will be an update
---> Package NetworkManager-glib.x86_64 1:1.18.0-5.el7 will be updated
---> Package NetworkManager-glib.x86_64 1:1.18.0-5.el7_7.1 will be an update
(中间省略……)
sos.noarch 0:3.7-6.el7.centos
systemd.x86_64 0:219-67.el7_7.1
systemd-libs.x86_64 0:219-67.el7_7.1
systemd-python.x86_64 0:219-67.el7_7.1
systemd-sysv.x86_64 0:219-67.el7_7.1
tuned.noarch 0:2.11.0-5.el7_7.1
Complete!

5. 重启

 

[root@localhost ~]# reboot

6. 验证主机名

 

[root@Server ~]# hostname
Server

7.验证防火墙状态

 

[root@Server ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

8. 验证selinux状态

 

[root@Server ~]# getenforce
Disabled



作者:复苏的兵马俑
链接:https://www.jianshu.com/p/016e6ba954cb
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

最后

以上就是细心酒窝为你收集整理的CentOS 8.0 基本配置的全部内容,希望文章能够帮你解决CentOS 8.0 基本配置所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部