Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


home directory is not created when i create a user (linux)

Posted on 2011-10-03
Medium Priority
Last Modified: 2012-06-21

i am trying tocreate a user but the home directory is not created even when i do

useradd -d /home/user1 user1
Question by:cismoney
  • 2
LVL 81

Expert Comment

ID: 36904236
Your use of the -d flag is the issue
man useradd
Quoted from the man pages:
" -d, --home HOME_DIR
          The new user will be created using HOME_DIR as the value for the
          userâs login directory. The default is to append the LOGIN name to
          BASE_DIR and use that as the login directory name. The directory
          HOME_DIR does not have to exist but will not be created if it is
If you must use -d you must then use the -m option to have the directory created.

useradd -D
Will show you the default settings for user addition.
useradd user1
will add user1 and create based on the default settings.
LVL 68

Accepted Solution

woolmilkporc earned 2000 total points
ID: 36904240
The flag to automatically create the homedir is "-m".
"-d" designates just its location.

LVL 81

Expert Comment

ID: 36904643
My answer pointed out the exact same thing.

Author Comment

ID: 36904688
yeah you right bro, I should have splitted the points. Sorry about that. Thanx for your help anyway

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question