What's the difference between
adduser? When/why should I prefer using one or the other?
In the case of Debian and its related distros, adduser is a friendlier interactive frontend to useradd.
On Ubuntu, useradd simply creates an entry in the user database (/etc/passwd etc.).
adduser on the other hand also creates a home directory for the user, populates it with the content of /etc/skel and lets you set the password interactively.
deluser when deleting users).
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).
addgroupadd 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 like
usermodprograms, by default choosing Debian policy conformant UID and GID values, creating a home directory with skeletal configuration, running a custom script, and other features.
addgroupcan be run in one of five modes:
useraddis a low level utility for adding users. On Debian, administrators should usually use
- What's the difference between “adduser” and “useradd”? (on SuperUser)
- What is the difference between
useradd? (on Ask Ubuntu).
lrwxrwxrwx. 1 root root 7 Nov 17 13:52 /usr/sbin/adduser -> useradd
One is a "shortcut" / "symbolic link" to the other. So no difference.
This is on redhat linux (and centos / fedora), it may not hold true on other distros.
adduser is a "friendly" interactive Q&A way to add local users.
useradd doesn't exist.