CentOS6及以下版本:修改/etc/sysconfig/network,添加HOSTNAME=xxx; CentOS7:在/etc/hostname中直接添加xxx 转载于:https://www.cnblogs.com/zhchy89/p/9494549.html