永久修改 CentOS6.10 主机名配置文件位置vim /etc/sysconfig/network Ubuntu 18.04.4和CentOS 8,CentOS7都有效 hostnamectl set-hostname 主机名 临时修改 hostname 新主机名称