1. 修改用户名称:
切换到root打开如下两个配置文件

sudo vim /etc/passwd

把我想改的"xxx"这个用户名改为"way"了,保存并退出 

sudo vim /etc/shadow

同样把"xxx"改为"way" ,保存并退出 

重启后名字就变成了way@xxx-ubuntu:

2. 现在要修改计算机名称xxx-ubuntu为way-ubuntu
修改有两步:
①. 修改/etc/hosts:

sudo vim /etc/hosts

127.0.0.1       localhost

192.168.76.21   way-ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
~                   

②. 修改/etc/hostname内容为
way-ubuntu
保存,退出,重启,就可以了。

啦啦啦

相关文章:

  • 2021-11-04
  • 2021-08-03
  • 2021-11-06
  • 2021-12-25
  • 2021-08-25
  • 2021-09-24
  • 2021-08-03
  • 2021-08-03
猜你喜欢
  • 2021-10-24
  • 2021-10-04
  • 2021-08-11
  • 2021-06-26
  • 2021-07-26
  • 2021-11-06
  • 2022-12-23
相关资源
相似解决方案