1、临时修改主机名 sudo hostname lyhost 2、永久修改主机名 vim /etc/sysconfig/network 修改里面的hostname字段即可,重启后生效。 转载于:https://www.cnblogs.com/relaxgirl/p/4528937.html