Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-09-2002, 12:11 PM
|
#1
|
|
Member
Registered: Apr 2002
Location: Denver
Distribution: SuSe,RedHat,Mandrake,
Posts: 109
Rep:
|
adding a new user doesn't create a home directory
It all started after I used the usermod command to modify the login for a user. User johnDo (fictitious for security reasons) was logged-in , I su - root to modify the login from johnDo to johnDoe using
#usermod -l johnDoe johnDo.
No problems so far. Then, for consistency reasons, I went ahead and modified the user's home directory from /home/johnDo to /home/johnDoe. I exited out of the root session, logged out as johnDo and logged back in. Then, I found out that to perform this operation one needs to be LOGGED-OUT from the user to be modified, or the system "gets confused", too late for this!. From then on every time I create a user, all the records are fine in the passwd file. My useradd -D are correct but the home directory for any user I'm adding does not get created. I hope that someone can post some ideas as to where to begin to triage this.
Thanks in advance.

|
|
|
|
08-09-2002, 12:17 PM
|
#2
|
|
Member
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388
Rep:
|
mkdir /home/<username>
chown <username>.<usergroup> /home/<username>
Regards
|
|
|
|
08-09-2002, 01:15 PM
|
#3
|
|
Member
Registered: Apr 2002
Location: Denver
Distribution: SuSe,RedHat,Mandrake,
Posts: 109
Original Poster
Rep:
|
Hi MartBrooks,
That is what I did as a workaround to get the user going and it's working fine. But my problem is that for every new user I create I have the same problem, and need to do this process again to create their directory, change owners, etc...
This wasn't happening before.....
Thanks.
|
|
|
|
08-09-2002, 05:00 PM
|
#4
|
|
Member
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113
Rep:
|
please look in the file /etc/defaults/useradd there you can give the defaults if and where, for expample, home directory should be created etc....
can you give the output of the file and what distro you are using?...
regards
|
|
|
|
08-09-2002, 05:05 PM
|
#5
|
|
Member
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549
Rep:
|
If you cant find a solution then just build a script and give it an alias.
This will speed up the whole process.
|
|
|
|
08-09-2002, 05:23 PM
|
#6
|
|
Member
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113
Rep:
|
hi,
my mistake in the last posting ...
read the man pages of useradd and you will see that by default there is no directory created. you should add the option -m to the command-->> useradd -m newuser and you will be fine,
take care
|
|
|
|
08-09-2002, 08:11 PM
|
#7
|
|
Member
Registered: Apr 2002
Location: Denver
Distribution: SuSe,RedHat,Mandrake,
Posts: 109
Original Poster
Rep:
|
Hi realos,
thanks for the input. I looked at the man pages for useradd did some testing using the -m flag and the directories are getting created. I still think that something happened when I used usermod logged in as the user to be modified. Actually when a user is added and no flags are passed to the useradd command, the defaults in useradd -D are created in my case is:
GROUP=100
HOME=/home
INACTIVE=0
EXPIRE=10000
SHELL=/bin/bash
SKEL=/etc/skel
I tested useradd on other machines same version ( SuSE 7.2) and the user's home directory are created by default just fine.
e.g
# useradd testing
if I su - testing
then cd
then pwd
I get .....
/home/testing
notice I did not specified -m
any way in the broken PC using -m works fine. From here I'd like to figure out what might've got broken.
pk21 thanks for the idea of creating a script I'm sure this can be a good resource when things get really bad.
Anyway thank you both for the input.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:34 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|