Linux下更改主机名(Ubuntu+Redhat)的方法,ubunturedhat


1.RedHat 企业版5.1

修改/etc/sysconfig/network改成为你想要的名字

修改 /etc/hosts加入IP与主机名字的映射

重启网络:service network restart

2.Ubuntu 11.04

root用户权限下

1.gedit /etc/hostname 把文件中的名字改成你想要的

2.gedit /etc/hosts 修改需要的部分

保存修改,重启网络或者重启电脑。

相关内容