Linux主机名修改位置

Linux主机名修改位置
centos6以下配置文件:cat /etc/sysconfig/network

      临时设置:hostname xunj 

      永久设置:修改/etc/sysconfig/network 文件里HOSTNAME=xunj   (需要重启系统)

centos7以上配置文件:cat /etc/hostname

      临时设置:hostname xunj 
      永久设置:hostnamectl set-hostname xunj (不需要重启系统,设置后直接写到/etc/hostname配置文件里)

posted @ 2021-08-10 23:30  从零到1  阅读(91)  评论(0编辑  收藏  举报