centos7修改主机名

来源:互联网 发布:双枪小帅的编程状态 编辑:程序博客网 时间:2024/06/18 01:52

1.修改 etc/sysconfig/network

vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=centos7_init

2. 修改/etc/hosts

vi /etc/hosts127.0.0.1   localhost centos7_init ::1         localhost centos7_init

3. 修改hostname

hostnamectl set-hostname centos7_init

4.重新启动系统

reboot -f

原创粉丝点击