得到主机名 通过命令行:hostname 修改主机名 hostnamectl set-hostname centos:修改主机名为centos 设置主机名为大小字母会自动转成小写字母哦 退出重新登录后会发现主机名已成功修改为centos