CentOS修改主机名

修改服务器主机名:
 
CentOS 7 / Fedora version 18 and above 
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"  

  

posted @ 2017-03-20 16:24  baoguok  阅读(141)  评论(0编辑  收藏  举报