博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Centos 修改主机名
阅读量:4524 次
发布时间:2019-06-08

本文共 396 字,大约阅读时间需要 1 分钟。

  1. 修改vi /etc/hosts
    127.0.0.1 Server_China localhost.localdomain localhost
  2. 修改vi /etc/sysconfig/network
    HOSTNAME=Server_China
  3. 输入下面命令生效
    #hostname Server_China
  4. centos7 设置主机名
    #!/bin/bashif [ $# -ne 1 ];then    echo `basename $0` "input hostname"else    hostnamectl --static set-hostname $1    hostnamectl --transient  set-hostname $1fi
    hostnamectl.sh

     

转载于:https://www.cnblogs.com/Mrhuangrui/p/4666557.html

你可能感兴趣的文章