centos7修改hostname 永久修改主机名 修改/etc/hostname文件 把localhost.hostname改成你想要的值(如下图我把该值改成h1)。 然后运行 su - 命令重载环境