Link to home
Create AccountLog in
Avatar of Williams225
Williams225

asked on

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

hello

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

Link to home
membership
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
Williams225

ASKER

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