如何修改linux计算机名

如何修改linux计算机名

1)open a shell, tpye the command below:
[root@kcn-110]#hostname kcn-110mw

2)edit the file:/etc/sysconfig/network, change the value of 'HOSTNAME':
[root@kcn-110]#vi /etc/sysconfig/network
=======================================================================
NETWORKING=yes
HOSTNAME=kcn-110mw
=======================================================================


3)edit the file:/etc/hosts, change the ip address and your hostname
[root@kcn-110]#vi /etc/hosts
====================================================================
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 localhost.localdomain localhost
192.168.0.110 kcn-110mw kcn-110mw
====================================================================


4)reboot network
/etc/sysconfig/network文件
改了以后要重启网络
/etc/init.d/network restart
service network restart

你可能感兴趣的:(linux)