useradd to create empty home dir

Kelly Dunlop kelly at xyzzy.clara.co.uk
Thu Oct 27 14:24:44 UTC 2005


On Thu, Oct 27, 2005 at 02:54:31PM +0100, Gary Stainburn wrote:
> How do I get useradd to create an empty home directory?
> 
> I've tried to use -k and --skel to point to /dev/null and to 
> /etc/empty_dir which believe it or not is an empty dir I created under 
> /etc
> 
> No matter what I try, useradd fails with exit code 2.  If I don't 
> specify -k or --skel it works fine.

>From reading the manual page exit code 2 is 'invalid command syntax' so
are you using the -m option as well:

	The -k option is only valid in conjunction with the -m option.

You shouldn't need to give a directory name because /etc/skel should
exist as an empty directory for it to use - it does on my FC4 system.

Of course /dev/null isn't a directory so that may cause problems.

Perhaps you need to post the exact command line you're using and which
version of Fedora so that the rest of us can try on our systems ?

Kelly
-- 
Kelly Dunlop
kelly at xyzzy.clara.co.uk




More information about the fedora-list mailing list