Error saying useradd warning the home directory already exists Not copying any file from skel directory into it

0 votes

I'm trying to create a new user for my Ubuntu, used this command:

sudo useradd -d /home/dinesh -m ansi

But I keep getting this error

useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

Why do I keep getting this error?

Jan 10, 2019 in Linux Administration by Dinesh
5,817 views

2 answers to this question.

0 votes
Best answer

Hey @Dinesh, this isn't an error, its a warning. 

You're trying to create a new user on the /home/dinesh directory but the system tries to create a new home directory. Hence the warning saying home directory already exists. But if you check your system a new user has already been created. Warnings don't interrupt like errors. 

answered Jan 10, 2019 by Sitara

selected Jan 10, 2019 by Kalgi

Why is the system trying to create a new home directory? 

When infact the command was correct: 

sudo useradd -d /home/dinesh -m ansi
0 votes

Hey @Dinesh, have a look at this thread - https://www.edureka.co/community/35292/create-new-user-on-ubuntu

It explains all the steps used to create a new user on ubuntu

Hope it helps :)

answered Jan 10, 2019 by Kalgi
• 52,310 points

Related Questions In Linux Administration

0 votes
1 answer
0 votes
1 answer

Proxy Error the proxy server received an invalid response from an upstream server.

Hi@akhtar, I think you did not configure your ...READ MORE

answered Apr 22, 2020 in Linux Administration by MD
• 95,140 points
1,260 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
291 views
0 votes
2 answers

Install postgreSQL on Ubuntu

Follow the below commands to install PostgreSQL (PSQL) ...READ MORE

answered Nov 11, 2020 in Database by Prachi
• 140 points
254 views
0 votes
1 answer

Access progrs prompt without switching accounts

Use the following to get the postgres prompt ...READ MORE

answered Mar 22, 2019 in Database by Mahi
177 views
0 votes
1 answer

Error saying "Failed to start httpd.service: Unit httpd.service not found."

Execute the following steps or make sure ...READ MORE

answered May 13, 2019 in Linux Administration by Kiara
13,572 views
0 votes
1 answer