CentOS修改主机名
修改服务器主机名:
CentOS 7 / Fedora version 18 and above
Enter the following command to set the hostname, replacing plato with the hostname of your choice:
Enter the following commands to set the hostname, replacing plato with the hostname of your choice:
Enter the following command to set the hostname, replacing plato with the hostname of your choice:
hostnamectl set-hostname plato
CentOS 6 / Fedora version 17 and below
Enter the following commands to set the hostname, replacing plato with the hostname of your choice:
echo "HOSTNAME=plato" >> /etc/sysconfig/network hostname "plato"