CentOS7 change the hostname hostname

hostnamectl set-hostname foo

foo is what you want to change the hostname
shown in the current host name hbza, we changed tianzhankui-hbza


figure su - re-log in as root, the new host name is effective immediately

Guess you like

Origin www.cnblogs.com/arisskz6/p/11707827.html