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 ~]# 

 

posted @ 2019-01-29 15:43  黑泽君  阅读(1098)  评论(0编辑  收藏  举报