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

Posted on 2011-10-03
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
    LVL 76

    Expert Comment

    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

    The flag to automatically create the homedir is "-m".
    "-d" designates just its location.

    LVL 76

    Expert Comment

    My answer pointed out the exact same thing.

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
    About FreeBSD Jails In FreeBSD, jails are a way of doing operating system level virtualization.  The basis of FreeBSD jails is chroot (, which changes the root directory of processes.  As a…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now