Centos7X永久更改主机名 与 Centos6X永久更改主机名 的区别

Centos7X永久更改主机名 

修改配置文件  vim /etc/hostname  保存退出,重启系统

[root@itheima ~]# vim /etc/hostname 
itheima130.com
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
                                                                                                                                                          
:wq
[root@itheima ~]# reboot
......
......
[root@itheima130 ~]# 

Centos6X永久更改主机名

修改配置文件  vim /etc/sysconfig/network  保存退出,重启系统

[root@hadoop ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop100
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
                                                                                                                                                          
:wq
[root@hadoop ~]# reboot
......
......
[root@hadoop100 ~]# 
原文地址:https://www.cnblogs.com/chenmingjun/p/10334406.html