Ubuntu 16.04服务器 配置

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
保存,退出,重启,就可以了。

啦啦啦

原文地址:https://www.cnblogs.com/ClassNotFoundException/p/7153087.html