LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 09-25-2009, 07:06 PM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: RHEL
Posts: 84
Thanked: 2
KNOPPIX Linux - User's Home Directory Not Getting Created


[Log in to get rid of this advertisement]
Hi Guys,


I have just installed KNOPPIX Linux on a Virtual Machine. This Linux Distro is great in the sense that I didn't find any difficulty in running its Live CD and then installing it.

Well, so here I am. I created a couple of user accounts but no directory was created for them under /home directory. Here's an example:

Code:
root@Microknoppix:~# useradd x
root@Microknoppix:~# passwd x
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@Microknoppix:~# ls /home
knoppix
root@Microknoppix:~# su - x
No directory, logging in with HOME=/
x@Microknoppix:/$ ls
KNOPPIX  bin   debian  etc   lib    mnt  proc  sbin     srv  tmp  var
Sept     boot  dev     home  media  opt  root  selinux  sys  usr  vmlinuz
x@Microknoppix:/$
As it can be seen from the above output that no home directory was created for the user. Yet, the user can create files and can do any work.


So, I looked at the file: /etc/default/useradd and uncommented the following line:

Code:
# The default home directory. Same as DHOME for adduser
HOME=/home
Of course, /home is already in existance!


So, what could it be wchich is causing the problem? Where can the user's home directry be going then?
linuxdebian Hi_This_is_Dev is offline  
Tag This Post , , ,
Reply With Quote
Old 09-25-2009, 08:14 PM   #2
MrChilly0
Member
 
Registered: Jan 2007
Distribution: back to gentoo
Posts: 69
Thanked: 3
From: man useradd: -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.


so...it'd be : useradd -m yourloginname
linux MrChilly0 is offline     Reply With Quote
Old 09-26-2009, 04:59 PM   #3
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: RHEL
Posts: 84
Thanked: 2

Original Poster
Thanks for your help! Yes, it works!

Code:
root@Microknoppix:/home/knoppix# useradd -m x
Creating mailbox file: File exists
root@Microknoppix:/home/knoppix# userdel -r x
userdel: /var/mail/x not owned by x, not removing
root@Microknoppix:/home/knoppix# useradd -m x
Creating mailbox file: File exists
root@Microknoppix:/home/knoppix# su - x
x@Microknoppix:~$
x@Microknoppix:~$ ls
x@Microknoppix:~$ ls /home
knoppix  x  y
x@Microknoppix:~$
linuxdebian Hi_This_is_Dev is offline     Reply With Quote
Old 09-26-2009, 05:01 PM   #4
repo
Senior Member
 
Registered: May 2001
Location: Belgium
Distribution: Debian/GNU Linux
Posts: 4,507
Thanked: 441
try adduser.
It's a script which let you create the home directory, password, etc
linuxdebian repo is online now     Reply With Quote
Thanked by:
Old 09-26-2009, 05:04 PM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: RHEL
Posts: 84
Thanked: 2

Original Poster
Well, there is a problem now. The users which I created previously, for example: the account of the user x

I delete it recursively and then create it again as shown below:

Code:
root@Microknoppix:/home/knoppix# userdel -r x
userdel: /var/mail/x not owned by x, not removing
root@Microknoppix:/home/knoppix# ls /home
knoppix  y
root@Microknoppix:/home/knoppix# useradd -m x
Creating mailbox file: File exists
root@Microknoppix:/home/knoppix# ls /home
knoppix  x  y
root@Microknoppix:/home/knoppix#

Kindly, consider the underlined lines in the commands and their outputs given above. If we are to remove the mail box manually then how do we do that?


Thanks in advance!
linuxdebian Hi_This_is_Dev is offline     Reply With Quote
Old 09-26-2009, 05:17 PM   #6
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: RHEL
Posts: 84
Thanked: 2

Original Poster
I think I have found it:


Code:
root@Microknoppix:~# find / -name mail
/var/mail
/var/spool/mail
/usr/lib/gimp/2.0/plug-ins/mail
^C
root@Microknoppix:~# ls /var/mail/
hi  x  y
root@Microknoppix:~# ls /var/spool/mail/
hi  x  y
root@Microknoppix:~# rm -rf /var/mail/x
root@Microknoppix:~# rm -f /var/spool/mail/x
root@Microknoppix:~# ls /var/mail
hi  y
root@Microknoppix:~# ls /var/spool/mail/
hi  y
root@Microknoppix:~# userdel -r x
root@Microknoppix:~# ls /home   
knoppix  y
root@Microknoppix:~# useradd -m x
root@Microknoppix:~# passwd x
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@Microknoppix:~# ls /home
knoppix  x  y
root@Microknoppix:~# su - x
x@Microknoppix:~$ ls
x@Microknoppix:~$
linuxdebian Hi_This_is_Dev is offline     Reply With Quote
Old 09-26-2009, 06:12 PM   #7
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: RHEL
Posts: 84
Thanked: 2

Original Poster
Thanks again! adduser command is great! So, I would like to use the useradd command as a short-hand.

Code:
root@Microknoppix:~# adduser --force-badname Me 
Allowing use of questionable username.
Adding user `Me' ...
Adding new group `Me' (1003) ...
Adding new user `Me' (1003) with group `Me' ...
Creating home directory `/home/Me' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for Me
Enter the new value, or press ENTER for the default
	Full Name []: Dev 
	Room Number []: Heaven
	Work Phone []: 0000
	Home Phone []: 0000
	Other []: 0000
Is the information correct? [Y/n] Y
root@Microknoppix:~# ls /home
Me  knoppix  x  y
root@Microknoppix:~#
linuxdebian Hi_This_is_Dev is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
User's home directory siva19185 Linux - Newbie 1 07-02-2008 05:22 AM
Not able to go to other user's home directory biswajit_dey Linux - Software 6 07-21-2005 09:14 AM
Reading other user's home directory with Samba zupidupi Linux - Networking 7 04-14-2005 02:53 AM
Changing user's home directory? HOW barton Debian 10 04-04-2005 03:27 AM
how to change a user's Home directory n1wil Linux - General 8 08-24-2002 04:22 PM


All times are GMT -5. The time now is 06:16 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration