Can somebody please explain to me the exact differences between useradd -b
and useradd -d
in [Debian] Linux? Both seem to work quite similar to me, but then I spot differences that confuse me.
Debian – difference between useradd -b and useradd -d
debianlinuxoptionsuseradd
Best Answer
-b
specifies the location of users' home directories. On your average Debian box, this will be/home
; you can change the default by editing/etc/default/useradd
.useradd
will add the new username to this path to get the home directory. This means that if you dothe new user's directory will be
/somewhere/ian
.-d
sets the home directory explicitly, irrespective of defaults. Sothen the user's home directory will be set to
/somewhere-else/ian
.Note that the directory will be set in the password file, but won't actually be created unless
-m
is also specified (or theCREATE_HOME
setting is enabled in the defaults file).