修改/etc/HOSTNAME文件,在此文件中保存主机名,例如: linuxserv1
然后运行命令设置主机名 # /etc/rc.d/boot.localnet start
方法3. 运行 sysctl 动态改变主机名 # sysctl -w kernel.hostname=linuxserv1