System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

useradd: warning: the home directory already exists

kumar_chandel
Occasional Contributor

useradd: warning: the home directory already exists

I'm trying to create a user in Linux by specifying the home directory with option -d. But I'm getting the below error:

 

[root@test123 ~]# useradd -c "Admin" -s /bin/ksh -d /oracle -g dba oracle123
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

 

What is the reason for the files not being copied from the /etc/skel directory?

4 REPLIES
Dennis Handly
Acclaimed Contributor

Re: useradd: warning: the home directory already exists

>What is the reason for the files not being copied from the /etc/skel directory?

 

Most likely because it thought you already did that and didn't want to destroy your customizations.

kumar_chandel
Occasional Contributor

Re: useradd: warning: the home directory already exists

Does it affect an user if the files .bash_profile and .bash_logout are not copied form the /etc/skel diretory in linux?

Dennis Handly
Acclaimed Contributor

Re: useradd: warning: the home directory already exists

>Does it affect an user if the files .bash_profile and .bash_logout are not copied form the /etc/skel directory in linux?

 

If the user uses bash.  :-)

And of course how much customization is done.

Naj
Valued Contributor

Re: useradd: warning: the home directory already exists

Hi,

 

Default values for account creation defined in /etc/default/useradd file  RHEL . Simply open this file using a text editor:

 

# vi /etc/default/useradd

 

The default home directory defined by HOME variable, find line that read as follows:

 

HOME=/home


Replace with:

HOME=/etc/skel

 

 

Hope this can help

 

Thanks

 

BR

Naj


____________________________________________
:: Really appreciate if you could assign some points.
:: Don't know how to assign point? Click the KUDOS! star!