Ubuntu modify the user name and host name

       I remember one time, I wanted to own a computer, "Ubuntu Cacalia" take a famous name, but asked for a long time and the degree of your mother Columbia Valley, I have to delete the current user (userdel -r xxx), to re-build a user ( adduser xxx), but my computer is all environment variables have a good job and do Android source development of children's shoes to know, how environment with a metamorphosis that middle step by mistake, it will lead to a few hours to compile the source code come to naught. However, I was like tossing Lord, is not a lot of children's shoes like me like to toss it? Well, ado, straight to the point:

1. Modify User Name:
to root open the following two configuration file
sudo gedit / etc / passwd
me want to change the "xxx" This user name was changed to "way", the save and exit
sudo gedit / etc / shadow
is also the "xxx" was changed to "way", save and exit
reboot name becomes a
Way @ xxx-ubuntu :
 
2. now you want to modify the computer name is xxx-ubuntu way-ubuntu
there are two steps to modify:
. ① modify / etc / the hosts: the sudo the gedit / etc / the hosts
127.0.0.1 localhost
192.168.76.21 Ubuntu-Way

# 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
~                   

②. Modify / etc / hostname content as
way-ubuntu
save, quit, restart it.

 

Reproduced in: https: //my.oschina.net/cjkall/blog/195787

Guess you like

Origin blog.csdn.net/weixin_34026276/article/details/91756284