LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2010, 10:12 PM   #1
New2LinuxMN
LQ Newbie
 
Registered: Sep 2010
Posts: 15

Rep: Reputation: 0
Created new user using useradd problem


I created a new user at the command line using useradd test. I went in and assigned a password to the account. I logged out and tried to log in as the new user and having problems.

I'm using openSUSE 11.3

First I get a message saying "Cannot enter home directory. Using /." Then a message saying "kstartupconfig4 does not exist of fails. The error code is 3..."

Any ideas what may be wrong.
 
Old 09-13-2010, 10:16 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
You did not specify a home directory when you ran useradd (-d or --home), nor did you specify that the home directory should actually be created (-m or --create-home). In future you may be better off using the higher level "adduser" command.

Cheers,

Evo2.
 
Old 09-13-2010, 10:26 PM   #3
New2LinuxMN
LQ Newbie
 
Registered: Sep 2010
Posts: 15

Original Poster
Rep: Reputation: 0
I thought that it uses the default that is in /etc/default/useradd. Was I wrong about this? My default HOME=/home.
 
Old 09-13-2010, 10:48 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Ok, so it seems that useradd did set the home dir, (can check by looking at /etc/passwd), but you still did not tell it to creat e it.

I think a careful reading of the useradd man page will clarify what happened.

Quote:
-m, --create-home
Create the user's home directory if it does not exist. The
files and directories contained in the skeleton directory
(which can be defined with the -k option) will be copied to
the home directory.

By default, if this option is not specified and CREATE_HOME is
not enabled, no home directories are created.
It seems the last sentence is key here.

Quote:
-d, --home HOME_DIR
The new user will be created using HOME_DIR as the value for
the user's login directory. The default is to append the LOGIN
name to BASE_DIR and use that as the login directory name. The
directory HOME_DIR does not have to exist but will not be
created if it is missing.
Again, the last sentence seems to apply.


Evo2.
 
Old 09-13-2010, 11:34 PM   #5
New2LinuxMN
LQ Newbie
 
Registered: Sep 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for all your help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't add local system user - useradd keeps saying user already exists ADeluiz Linux - Security 5 07-26-2013 04:17 PM
[SOLVED] Mint8 Helena LiveCD on USB Stick - Always logs into Mint user, not newly created user rrrssssss Linux Mint 3 04-20-2010 03:14 PM
useradd - No home directory is created ]SK[ Linux - Newbie 16 07-14-2008 02:35 PM
users created by "useradd" cannot remotely login with PuTTY. Why? Kreshna Linux - Software 4 10-16-2006 10:56 AM
problem executing user created scripts on console farooqmaniar Linux - Software 1 01-12-2006 07:06 PM


All times are GMT -5. The time now is 01:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration