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

x
?
Solved

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

Posted on 2011-10-03
4
Medium Priority
?
405 Views
Last Modified: 2012-06-21
hello

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

useradd -d /home/user1 user1
0
Comment
Question by:cismoney
  • 2
4 Comments
 
LVL 81

Expert Comment

by:arnold
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
          missing.
"
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.
0
 
LVL 68

Accepted Solution

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

wmp
0
 
LVL 81

Expert Comment

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

Author Comment

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

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