摘要
linux更改主机名三步曲
第一步:
#hostname olinux
第二步:
修改/etc/sysconfig/network中的hostname
修改为hostname=olinux
第三步:
修改/etc/hosts文件
Centos/Redhat更改主机名三步曲
(1)修改/etc/hosts,将/etc/hosts内出现的localhost都改成olinux。
(2)修改/etc/sysconfig/network,将该文件内容hostname=olinux。
(3)执行“hostname olinux”,临时修改一下。当下次重启系统,则真正生效。
如果是Ubuntu/Debian:
修改步骤和上面类似:
(1)修改/etc/hosts,将/etc/hosts内出现的localhost都改成olinux。
(2)修改/etc/hostname,将该文件内容由localhost修改为olinux。
(3)执行“hostname olinux”,临时修改一下。当下次重启系统,则真正生效。
您可以选择一种方式赞助本站
支付宝转账赞助
