CentOS 6.5
[1] Change hostname with a commnad (but if rebooting, it will be back).
[[email protected] ~]# hostname # show current hostname srv1.vpsmate.net [[email protected] ~]# hostname srv2.vpsmate.net # change hostname [[email protected] ~]# hostname srv2.vpsmate.net
[2] Change hostname permanently.
[[email protected] ~]# vi /etc/sysconfig/network # change HOSTNAME=srv2.vpsmate.net [[email protected] ~]# exit CentOS release 6.5 Kernel xxx srv2.vpsmate.net login: # changed
CentOS 7
[1]Change hostname with a commnad (but if rebooting, it will be back).
[[email protected] ~]# hostname # show current hostname srv1.vpsmate.net [[email protected] ~]# hostname srv2.vpsmate.net # change hostname [[email protected] ~]# hostname srv2.vpsmate.net
[2] Change hostname permanently.
[[email protected] ~]# vi /etc/hostname # change srv1.vpsmate.net [[email protected] ~]# exit CentOS Linux 7 Kernel 3.10.0-123.4.2.el7.x86_64 on an x86_64 srv1 login: # just changed
Comments