Debian: create a new user without home directory
How do I create a new user in Debian without home directory?
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.
On Debian based systems typically the adduser
command is used to create new accounts instead of directly calling useradd
.
The adduser
option to skip creating a home directory is --no-create-home
.