{ 8 comments… read them below or add one }

1 santhosh kumar theyyan May 6, 2008

or specify the home with -d in useradd command

Reply

2 ashwani May 23, 2009

Nice…info…but it doesnt work ;_( it still gives same error as before changeing in /etc/default/usradd

[root@localhost ~]# useradd -d /root/lvm/ mas
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

Reply

3 Jay A June 18, 2009

Hi All,
Anyone who can teach me the solution for this problem:

I add a user jayabellon using this command:
useradd -u 888 -g oinstall -G dba -d /home/jayabellon -r jayabellon

i forgot to create home directory when I log-In so it prompts me cannot go to that directory.

I deleted the user and retry to create again.

But still, when I log-In, this is what it looks like:
-bash-3.00$

I am expecting it to be
[user@hostname]$

this is my entry in /etc/passwd:
jayabellon:x:888:501:jayabellon:/home/jayabellon:/bin/bash

actually, i am only working in a test server. Nothing much critical on this one.
It’s just that its my first time to create user using command line, because i usually do it in GUI based.

REgards,
Jay A

Reply

4 Jay A June 18, 2009

-bash-3.00$ finger jayabellon
Login: jayabellon Name: jayabellon
Directory: /home/jayabellon Shell: /bin/bash
Never logged in.
No mail.
No Plan.

Reply

5 Vivek Gite June 18, 2009

Pass -m option to useradd command to create users home dir.

Reply

6 Jay A June 19, 2009

I got it.

it’s in man page also.

:D

found that it’s faster to create user in command line rather than using GUI Administration tool.

Thanks Vivek

Reply

7 Shash April 27, 2010

Any chance you can provide a similar command for Oracle SQL?

Reply

8 TonyRiver December 29, 2011

Thanks. I’ve been wondering how to change the default home directory for a while now. Glad I found this to explain how.
Your comment is awaiting moderation.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 4 + 12 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: