更改centos的hostname

临时更改法:

[root@vagrant-centos65 ~]# hostname
vagrant-centos65.vagrantup.com

[root@vagrant-centos65 ~]#  hostname node
[root@vagrant-centos65 ~]# hostname
node

 

永久更改法:

[root@vagrant-centos65 etc]# vi /etc/sysconfig/network

#HOSTNAME=vagrant-centos65.vagrantup.com
HOSTNAME=node1
NETWORKING=yes

 

重启之后即可

[root@vagrant-centos65 etc]# reboot
[root@vagrant-centos65 etc]#

[root@node1 ~]# 

posted @ 2022-03-22 10:53  qian@@jing  阅读(27)  评论(0编辑  收藏  举报