LinuxQuestions.org
Help answer threads with 0 replies.
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-15-2009, 11:19 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Rep: Reputation: 51
useradd and the home directory.


Hi:
I have a problem with useradd. I do 'useradd john'. Then I look in /etc/passwd and see that the new entry has ...:/home/john: in it. Then I do passwd john and I enter a password. However, when I log in as john, the system says "No directory. Logging in with HOME=/". How can this be? And looking into /etc/default/useradd I find HOME=/home.
If someone could help me I would greatly apreciate it.
 
Old 09-15-2009, 11:23 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Do you use the -m option when using useradd? Check the man page.
 
Old 09-16-2009, 01:46 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by Wim Sturkenboom View Post
Do you use the -m option when using useradd? Check the man page.
No. I did not. I read the man page and have seen what it does. Thank you very much.
 
Old 09-16-2009, 02:26 AM   #4
dezza
Member
 
Registered: Nov 2004
Location: Denmark
Distribution: ArchLinux, Debian
Posts: 132

Rep: Reputation: 18
Check in /home ..

Code:
cd /home
ls
If john is not there you should create it and chown it to john ..

Code:
mkdir john
chown john.john
Code:
dezza ~ $  cd /home/
dezza /home $  ls
dezza
john
dezza /home $ chown john.john john
 
Old 09-16-2009, 05:05 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by dezza View Post
Code:
dezza ~ $  cd /home/
dezza /home $  ls
dezza
john
dezza /home $ chown john.john john
I believe the chown syntax is <user>:<group> rather than <user>.<group> and the appropriate group is the user's primary group which may not be the same as their user name. The user's primary group may be determined by looking at the 4th :-separated field in their entry in /etc/passwd and then looking for the group in /etc/group which has the same number for its 3rd :-separated field.
 
Old 09-16-2009, 05:19 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
You're better off using adduser, it's more interactive, sets up home, groups, shell, everything.
 
Old 09-16-2009, 07:18 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by brianL View Post
You're better off using adduser, it's more interactive, sets up home, groups, shell, everything.
Some of us are just naturally primitive!

Seriously -- I prefer to set things up using non-interactive commands that can be logged by copy-and-paste from terminal to log and reproduced the next time by copy-and-paste from log to terminal.
 
Old 09-16-2009, 09:42 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

I have to agree with 'brianL' that 'adduser' is the way to go as it is the frontend for 'useradd'. 'adduser' was created specifically for Slackware adding new user accounts. But as usual Slackware allows one to do as they wish on their system.
 
  


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
useradd: cannot create directory /home/ amirzkria Red Hat 5 08-07-2014 10:11 AM
useradd - No home directory is created ]SK[ Linux - Newbie 16 07-14-2008 02:35 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
Useradd not creating home directory when creating newuser meneedham Linux - Newbie 4 10-05-2007 01:11 PM


All times are GMT -5. The time now is 06:58 PM.

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