sudo adduser username
其中username
替换成要创建的用户名
然后会要求输入一些信息,其中密码是必填的,并需要输入两次以确认密码。非必填信息可直接回车跳过,最后输入Y确认即可。
root@x-xlarge:~# sudo adduser vien
Adding user `vien' ...
Adding new group `vien' (1000) ...
Adding new user `vien' (1000) with group `vien' ...
Creating home directory `/home/vien' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for vien
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y
sudo usermod -aG sudo username
其中username
替换成要创建的用户名