修改hostname

[root@localhost Desktop]# hostnamectl 
   Static hostname: localhost.localmain
         Icon name: computer
           Chassis: n/a
        Machine ID: 95149af3c9cb485e84024bac7eb7f926
           Boot ID: 13df46d46e3b489598f16f0a28415f1e
    Virtualization: vmware
  Operating System: Red Hat Enterprise Linux Server 7.1 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.1:GA:server
            Kernel: Linux 3.10.0-229.el7.x86_64
      Architecture: x86_64
[root@localhost Desktop]# hostnamectl set-hostname biubiu

关闭终端窗口重新打开

[root@biubiu Desktop]# 

不reboot窗口名不变,重启后窗口名随之改编

localhost显示为ip地址,localhost.localmain显示为”loaclhost”

posted on 2021-10-10 20:42  没茶喝  阅读(187)  评论(0)    收藏  举报