Not really sure if you can create a user which doesn't have a home directory specified. That being said, the specified home directory doesn't have to exists. You can call the adduser with the option --no-create-home.
adduser --no-create-home foo
(adduser is usually the preferred higher level tool if called interactively.)
According to the man page of useradd(8) you either want to add the parameter -M to your useradd call or you want to set CREATE_HOME=no in /etc/default/useradd.
-M
Do no create the user's home directory,
even if the system wide setting from
/etc/login.defs (CREATE_HOME) is set to yes.
Not really sure if you can create a user which doesn't have a home directory specified. That being said, the specified home directory doesn't have to exists. You can call the adduser with the option --no-create-home.
adduser --no-create-home foo
(adduser is usually the preferred higher level tool if called interactively.)
According to the man page of
useradd(8)
you either want to add the parameter-M
to youruseradd
call or you want to setCREATE_HOME=no
in/etc/default/useradd
.On Debian based systems typically the
adduser
command is used to create new accounts instead of directly callinguseradd
.The
adduser
option to skip creating a home directory is--no-create-home
.$ useradd joe $useradd -m joe does the opposite
edit : rtfm ;) http://linux.die.net/man/8/useradd
As root on a Linux machine
Parameter of command
useradd
: