CentOS7操作系統下永久修改主機名

操作系統:CentOS Linux release 7.8

任務:修改主機名爲sky9899

操作步驟如下:

[root@146 ~]# hostname

*.*.*.*.adsl-pool.jx.chinaunicom.com

[root@146 ~]# hostnamectl

   Static hostname: localhost.localdomain

Transient hostname:  *.*.*.*.adsl-pool.jx.chinaunicom.com

         Icon name: computer-server

           Chassis: server

        Machine ID: 3bd1b96900b8403b8c8d3405d6ad99af

           Boot ID: ba99cb9810f5449f9f7509e0c5e241e5

  Operating System: CentOS Linux 7 (Core)

       CPE OS Name: cpe:/o:centos:centos:7

            Kernel: Linux 3.10.0-1062.el7.x86_64

         Architecture: x86-64

[root@146 ~]# hostname

*.*.*.*.adsl-pool.jx.chinaunicom.com

[root@146 ~]# hostnamectl   --static  set-hostname  sky9899

[root@146 ~]# hostname

sky9899

[root@sky9899 ~]# 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章