如何在centos8中修改主机名hostname

在RHEL 8中设置主机名

将主机名设置为oir.rhel8

$ sudo hostnamectl set-hostname oir.rhel8

修改配置文件 /etc/hosts

127.0.0.1	oir.rhel8

重启网络服务,使修改生效

$ sudo systemctl restart NetworkManager

查看当前的主机名

$ hostname
或者
$ hostnamectl
日期:2019-04-29 03:18:02 来源:oir作者:oir