ubuntu修改hostname

修改/etc/hostname文件就可以了,
  root@ubuntuServer:/etc# more hostname
  #ubuntu
  newname
  
  但是这样一来在X下面,很多命令不正常,比如打开terminal出不来,原来还需要修改
  /etc/hosts文件,
  127.0.0.1 localhost.localdomain localhost newname
  #
  # The following lines are desirable for IPv6 capable hosts
  ::1 ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  ff02::3 ip6-allhosts

作者:我是刘先生
地址:https://www.cnblogs.com/cekaigongchengshi/
文章转载请标明出处,如果,您认为阅读这篇博客让您有些收获,不妨点击一下推荐按钮,据说喜欢分享的,后来都成了大神

欢迎扫码关注微信公众号
原文地址:https://www.cnblogs.com/cekaigongchengshi/p/13953497.html