天天看點

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

Copyright ©2018-2019

繼續閱讀