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

 

查看原文