Loading

Linux常用命令

centos7修改hostname

hostnamectl set-hostname centos102  # 使用这个命令会立即生效且重启也生效
vi /etc/hosts                       # 编辑下hosts文件, 给127.0.0.1添加hostname
cat /etc/hosts                      # 检查hosts
127.0.0.1   localhost centos102
::1         localhost centos102
posted @ 2020-06-14 14:32  shih945  阅读(120)  评论(0编辑  收藏  举报