LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-01-2004, 10:07 AM   #1
waynevnc
Member
 
Registered: Jun 2004
Location: New Mexico
Distribution: Debian 3.0, Pop!_OS, Manjaro
Posts: 60

Rep: Reputation: 15
how are home directories created


Some explanation please.

I was under the impression, which must be wrong, that a users home directory was created when the useradd command was used to create a user account. I have created several users and only the first one I created has a home directory. What the deal?

Thanks for any info on this,
Wayne
 
Old 07-01-2004, 11:19 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I'll try to explain this on the basis of the console command useradd; the manpage of useradd says:

useradd - Create a new user or update default new user information

now there are several options you can pass to this command. if you use graphical tool, then you must specify the options in the gui tool, so that it then creates the user on the base of those...anyway, I'll do this console-based. here's a cut from useradd's manpage:

"When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. The new user account will be entered into the system files as needed, the home directory will be created, and initial files copied, depending on the command line options."

when you add a user, the shortest way is of course this:

useradd username

which whould create a user called username, and that's it. no home dir or anything _unless_ there are some default values set that tell useradd to do so...but basically you won't get a home directory, for example. if you want that, you would use the -d option:

useradd -d /home/homedir username

which would create a new user called username and set /home/homedir to his/her home directory...other options include -c (comment), -e (expire date), -g (initial group), -G (groups), -p (password), -s (shell), -u (uid) etc. etc. etc.

so the things you get when creating a user depend on what command line parameters you give to the useradd program. GUI tools work in the same way, but with the difference that you choose the options in the graphical window and then the GUI tool does these command line parameter thingies for you.

hopefully this explained a bit...you get what you ask, and if you don't ask for something (and nobody has set defaults for that action), you don't get that something
 
Old 07-01-2004, 02:47 PM   #3
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
The Debian 3.0 manpage also says
Code:
The adduser program is generally more friendly to use than
this one and also uses Debian policy  conformant  UID  and
GID values, creating a home directory a with skeletal con_
figuration, running a custom script, and  other  features.
It is more prefered than using this program.
adduser is easier to use.
 
Old 07-02-2004, 08:39 AM   #4
waynevnc
Member
 
Registered: Jun 2004
Location: New Mexico
Distribution: Debian 3.0, Pop!_OS, Manjaro
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks guys, thats what I needed to know.
 
  


Reply



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
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
Automount home directories??? BeauSanders Linux - Networking 2 09-15-2005 04:16 PM
ProFTPD: Set umask so that directories are created with 'sticky bit' on. dutch2005 Linux - Software 1 09-06-2005 05:06 AM
HELP! When I create a new user a home dir isn't created lynchpin9 Linux - General 5 01-18-2005 11:05 AM
how to find directories created in the last 30 mins? a128 Programming 1 02-04-2004 11:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:07 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