What is the difference between adduser and useradd?
useradd
is native binary compiled with the system. But,adduser
is a perl script which usesuseradd
binary in back-end.
adduser
is more user friendly and interactive than its back-enduseradd
. There's no difference in features provided.
Source: What's the difference between “adduser” and “useradd”?
Always use adduser
(and deluser
when deleting users) when you're creating new users from the command line. (If you're writing a script, especially if you aim for portability, you might want to use the lowlevel utilities instead – and adduser
/deluser
might not be available on all distros, e.g. on SuSE.)
The useradd
, userdel
and usermod
commands are lowlevel utilities which are there for historical reasons, while adduser/deluser
Do The Right Thing™. (I remember which to use by thinking that user*
comes after adduser/deluser
in the alphabet, and therefore is "worse".)
According to the respective manpages (on Ubuntu 12.04 Precise Pangolin, i.e. a Debian derivative system).
Manpage for adduser
says:
(Emphasis added.)
adduser
andaddgroup
add users and groups to the system according to command line options and configuration information in/etc/adduser.conf
. They are friendlier front ends to the low level tools likeuseradd
,groupadd
andusermod
programs, by default choosing Debian policy conformant UID and GID values, creating a home directory with skeletal configuration, running a custom script, and other features.adduser
andaddgroup
can be run in one of five modes:
Manpage for useradd
says:
useradd
is a low level utility for adding users. On Debian, administrators should usually useadduser(8)
instead.
See also: What's the difference between “adduser” and “useradd”? (on SuperUser)
adduser
: add user with full profile and info (pass, quota, permission, etc.)
useradd
: add user with his name only (if you want to add a temp user with only a name,other info not required)