Linux虚拟机修改主机名
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
1.修改/etc/hosts文件,自定义主机名,这里修改为master。
```
[root@localhost ~]# vi /etc/hosts
127.0.0.1 localhost master localhost4 localhost4.localdomain4
::1 localhost master localhost6 localhost6.localdomain6
```
2.修改/etc/sysconfig/network文件
```
[root@localhost ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=master
```
3.重启,使用hostname命令,即可看到主机名已将修改为master
```
[root@master ~]# hostname
master
```
这样就可以看到主机名改成了master




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)