方法1)通过修改配置文件的方式并运行命令修改主机名
修改/etc/HOSTNAME文件,在此文件中保存主机名,例如:
linuxserv1
然后运行命令设置主机名
# /etc/rc.d/boot.localnet start
方法2) 通过yast2管理工具进行配置
在console中运行yast2工具修改主机名(hostname)
# yast2 network
yast2 修改主机名时变更的文件有:
/etc/sysconfig/SuSEfirewall2
/etc/sysconfig/windowmanager
/etc/sysconfig/network/config
/etc/sysconfig/network/ifcfg-eth0 IP设置
/etc/hosts.YaST2save
/etc/init.d/.depend.boot
/etc/init.d/.depend.start
/etc/init.d/.depend.stop
/etc/init.d/.depend.halt
/etc/postfix
/etc/postfix/main.cf
/etc/modprobe.conf.YaST2save
/etc/modprobe.d/50-ipv6.conf
/etc/HOSTNAME
/etc/udev/rules.d/79-yast2-drivers.rules
/etc/udev/rules.d/70-persistent-net.rules 网卡MAC配置文件
/etc/modprobe.conf
/etc/hosts
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22661144/viewspace-1413424/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22661144/viewspace-1413424/