linux CentOS(6、7)修改主机名(hostname)

一、centos6和7临时修改

[root@centos6 ~]# hostname 132
[root@centos6 ~]# hostname
132

二、永久修改
1、centos6

[root@centos6 ~] # vim /etc/sysconfig/network

2、centos7

[root@centos7 ~] # hostnamectl set-hostname centos7
或者
[root@centos7 ~] # vim /etc/hostname
[root@centos7 ~] # exec bash

猜你喜欢

转载自blog.csdn.net/borntodieee/article/details/80479466