renew

 apt update

Create a normal user

Install the necessary components

 apt install python3 python3-pip wget dos2unix sudo lsb-release iproute2

Enter the passwd root command to change the password of the root user

 root@6805b104cdc1:/# passwd root
Enter new UNIX password:
Retype new UNIX password:

Enter the adduser jiuzhang command to create a sudo user

 root@6805b104cdc1:/vagrant# adduser jiuzhang
Adding user `jiuzhang' ...
Adding new group `jiuzhang' (1000) ...
Adding new user `jiuzhang' (1000) with group `jiuzhang' ...
Creating home directory `/home/jiuzhang' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for jiuzhang
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

And add sudo permissions to the user just created usermod -aG sudo jiuzhang

 root@6805b104cdc1:/vagrant# usermod -aG sudo jiuzhang

Enter the su - username command to switch to the newly created user:

Enter the following after executing the command:

 root@a6ef0c93187f:/vagrant# su - jiuzhang
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

jiuzhang@a6ef0c93187f:~$

Use the sudo command to run the whoami command, you can see the following output, root means that the current user has privileges

 jiuzhang@a6ef0c93187f:~$ sudo whoami
[sudo] password for jiuzhang: 
root

universe_king
3.4k 声望680 粉丝