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 in Linux Administration by Dinesh
518 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 by Sitara

selected Jan 10 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 by Kalgi
• 39,310 points

Related Questions In Linux Administration

0 votes
1 answer
0 votes
1 answer

Not able to access /etc/sudoers.d/python file

I think your system is not allowing ...READ MORE

answered Feb 6 in Linux Administration by Lohit
85 views
0 votes
1 answer

how to loop through the content of a file using bash

One of the ways to do it ...READ MORE

answered Feb 15 in Linux Administration by ajs3033
• 7,280 points
66 views
0 votes
0 answers

Error while enabling the official puppet

I'm trying to enable the official puppet lab ...READ MORE

Feb 27 in Linux Administration by mytamhuyet
• 120 points

edited Apr 10 by mytamhuyet 20 views
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
73 views
0 votes
1 answer

Install postgreSQL on Ubuntu

Installing PostgreSQL on Ubuntu is very simple, ...READ MORE

answered Mar 22 in Database by Nitesh
37 views
0 votes
1 answer

Access progrs prompt without switching accounts

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

answered Mar 22 in Database by Mahi
23 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 in Linux Administration by Kiara
135 views
0 votes
1 answer