0
点赞
收藏
分享

微信扫一扫

Centos Linux查看和设置主机名

小猪肥 2024-09-27 阅读 1
Linux运维

查看主机名使用hostname或者hostnamectl命令

[root@sre01 ~]# hostname
sre01

[root@sre01 ~]# hostnamectl 
   Static hostname: sre01
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 75e915fb06a74c648bb373f7e884d48e
           Boot ID: 618ec6663e934124a68396b66579ea6a
    Virtualization: vmware
  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

修改主机名使用hostnamectl命令永久生效

[root@sre01 ~]# hostnamectl set-hostname sre02

举报

相关推荐

0 条评论