Link to home
Create AccountLog in
Avatar of Williams225

asked on

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


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

useradd -d /home/user1 user1
Avatar of arnold
Flag of United States of America image

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.
Avatar of woolmilkporc
Flag of Germany image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
My answer pointed out the exact same thing.
Avatar of Williams225


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