标签:kernel 3.1 添加 red ase 命令 使用 arch 若是
原来主机名
[root@node1 ~]#
查看Centos的版本:
[root@node1 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)
确定版本后,Centos7特地添加了hostnamectl命令查看和修改:
[root@node1 ~]# hostnamectl Static hostname: node1 Icon name: computer-vm Chassis: vm Machine ID: ef4a922d17fb4282a34a47c69588ffad Boot ID: 0ab461ff770745c8a7a4d59ede5888df Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-862.2.3.el7.x86_64 Architecture: x86-64
对主机名进行修改:
[root@node1 ~]# hostnamectl set-hostname xxxxx
查看是否修改成功:
[root@node1 ~]# cat /etc/hostname
xxxxx
若是使用Xshell客户端进行修改的,可以断开后再连接,即可看到修改后的主机名:
[root@xxxxx ~]#
标签:kernel 3.1 添加 red ase 命令 使用 arch 若是
原文地址:https://www.cnblogs.com/xiaoai666/p/9288230.html