Create user wthout a home directory

HI,
In one of the tasks we have to create a user without a home directory. I ran the useradd -M command and was able to successfully execute the task.
However I want to ask you that in this case when the created user does not have a home directroy, where are the users files stored, Under which path??
Please giuide me.

Regards
Sanjith

Hello @Sanjith-R-Warrier,
the use case of this behavior is to run a service using this user and no need to create files are owned by this user.

Sir,
Your reply is not clear. Could you rephrase it??

Hello,
Due to the security reasons and privileges of the users, Linux administrators have to create some users without a home directory to run a service on the system, daemon accounts (accounts associated with services) and other system accounts have no home directories, so no need to create files are owned by these users.

also, You may possibly want to use -M with useradd if the new user’s home directory already exists.
Note that the -M option turns off the creation of the user’s home directory. You may use -d to assign a home directory to the new user while at the same time using -M.

1 Like