Linux - GeneralThis 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.
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.
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.
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 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:
I tested useradd on other machines same version ( SuSE 7.2) and the user's home directory are created by default just fine.
# useradd testing
if I su - testing
I get .....
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.