LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-25-2009, 06:06 PM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
KNOPPIX Linux - User's Home Directory Not Getting Created


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?
 
Old 09-25-2009, 07:14 PM   #2
MrChilly0
Member
 
Registered: Jan 2007
Location: midwest USA
Distribution: gentoo w/ funtoo overlay
Posts: 146

Rep: Reputation: 23
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
 
Old 09-26-2009, 03:59 PM   #3
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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:~$
 
Old 09-26-2009, 04:01 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
try adduser.
It's a script which let you create the home directory, password, etc
 
Old 09-26-2009, 04:04 PM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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!
 
Old 09-26-2009, 04:17 PM   #6
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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:~$
 
Old 09-26-2009, 05:12 PM   #7
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
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:~#
 
  


Reply

Tags
directory, home, knoppix, users



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:31 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
Open Source Consulting | Domain Registration