centos--设置主机名
修改主机名hostname与root@后面主机名显示
centos7.5
之前

修改 hostname 命令显示的主机名
[root@two huan_yang]# vim /etc/hostname 
two.kong.com
[root@two huan_yang]# systemctl restart systemd-hostnamed
[root@two huan_yang]# hostname
two.kong.com
或者
[root@two huan_yang]# hostnamectl set-hostname two.kong.com
[root@two huan_yang]# reboot

                
            
浙公网安备 33010602011771号