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
LinuxUnix OS
Last Comment
Williams225
8/22/2022 - Mon
arnold
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.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
yeah you right bro, I should have splitted the points. Sorry about that. Thanx for your help anyway
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
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.