Ubuntu creates users adduser and useradd

The difference between adduser and useradd#

When you first contact the user management content of Ubuntu, you may have such doubts. Both adduser and useradd in Ubuntu can be used to create users. There are many introductions on the Internet about the difference between the two, but some of these introductions are not accurate. Make a comparison of the difference between the two:

Create a user newuser

useradd newuser

Set password for newuser

passwd newuser

Set home directory for newuser

useradd -d /home/newuser newuser

Create a user newuser and set the password interactively

adduser newuser

Set sudo permissions#

To add sudo permissions to users, you can use two methods to modify sudoers and adduser. The second method is recommended:
The etc/sudoers file is the file related to the sudo group, add a line in it

newuser ALL=(ALL) ALL

The second is to use the adduser command, one line directly:

adduser newuser sudo

Recommended Posts

Ubuntu creates users adduser and useradd
Summary: Ubuntu Python2.x and
Add new users under ubuntu and kick out online users
Ubuntu20.04 experience and beautification
Ubuntu introduction and installation
[python] python2 and python3 under ubuntu
Ubuntu backup and restore
ubuntu16.04 build vim and pyt
Ubuntu 16.04 compile and install PHP 7.2
ubuntu18.04 compile and install python3.8
Ubuntu14.04 creates Genymotion virtual machine
Ubuntu16.04 installation and simple configuration
Jmeter (18)_Ubuntu deploy jmeter and ant
ubuntu install and configure GitLab
Ubuntu deployment and experience Nexus3
Centos7 creates LVM and expands
Ubuntu16.04 install SVN and configuration
Ubuntu16.04 install and uninstall VMware-Workstation 14
Ubuntu PostgreSQL installation and configuration