Centos7.5.1804永久生效修改主机名
生活随笔
收集整理的這篇文章主要介紹了
Centos7.5.1804永久生效修改主机名
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
原來主機(jī)名
[root@node1 ~]#查看Centos的版本:
[root@node1 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)確定版本后,Centos7特地添加了hostnamectl命令查看和修改:
[root@node1 ~]# hostnamectlStatic hostname: node1Icon name: computer-vmChassis: vmMachine ID: ef4a922d17fb4282a34a47c69588ffadBoot ID: 0ab461ff770745c8a7a4d59ede5888dfVirtualization: vmwareOperating System: CentOS Linux 7 (Core)CPE OS Name: cpe:/o:centos:centos:7Kernel: Linux 3.10.0-862.2.3.el7.x86_64Architecture: x86-64對主機(jī)名進(jìn)行修改:
[root@node1 ~]# hostnamectl set-hostname xxxxx查看是否修改成功:
[root@node1 ~]# cat /etc/hostname xxxxx若是使用Xshell客戶端進(jìn)行修改的,可以斷開后再連接,即可看到修改后的主機(jī)名:
[root@xxxxx ~]#?
轉(zhuǎn)載于:https://www.cnblogs.com/xiaoai666/p/9288230.html
總結(jié)
以上是生活随笔為你收集整理的Centos7.5.1804永久生效修改主机名的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一场面试,用20秒介绍自己顺便教训了领导
- 下一篇: PLSQL Developer概念学习系