修改linux的hostname

针对suse linux系统,比如要把hostname改为linux150

1.linux150:~ # hostname linux150

这一步改后立即生效,但重启后会恢复到之前的样子

2.linux150:~ # vi /etc/HOSTNAME

在HOSTNAME文件里把主机名linux150添加进去

3.linux150:~ # vi /etc/hosts

hosts一般会有主机名和IP的映射,有的话需要对应修改下

猜你喜欢

转载自portalpig.iteye.com/blog/2150899