useradd doesn't create /home/user_name directory
Bug #603283 reported by
Ioannis Vranos
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shadow (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I tested the bug under Ubuntu 9.10 x64 Server and 10.04 x64 Desktop.
The command:
useradd -c "First name, Last name" [-d /home/user_name] user_name
doesn't create the directory /home/user_name, so when the user user_name logs in the console, he is presented with the error message:
No directory, logging in with HOME=/
Tested with Fedora 13 x64, and it works OK there.
ProblemType: Bug
Architecture: amd64
Date: Thu Jul 8 21:17:14 2010
DistroRelease: Ubuntu 9.10
NonfreeKernelMo
Package: passwd 1:4.1.4.1-1ubuntu2
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: shadow
Uname: Linux 2.6.31-22-generic x86_64
To post a comment you must log in.
Thank you for this report. I can understand there are differences in distros sometimes. The default configuration for Debian is to not create the home directory. You have to explicitly use the -m option to do so.
Curiously, the question of whether to automatically create the home directory is not part of the defaults (/etc/defaults/ useradd) as far as I can see.
Also, the -d option by itself is not quite what it seems. I note this from the changelog:
- debian/ patches/ 459_better_ document_ useradd_ -d
Better document, in useradd.8, that the home_dir specified
with -d is not created if it does not exist
Closes: #154996
And:
- useradd requires the -m option to make it create a home directory
if one does not exist, closes: #39581
So this specific behavior was decided upon in Debian. It is possible, for different reasons, Fedora chose a different default behavior in this respect.
In any case, I think the package maintainer should now have enough info to understand if this needs to be changed, better documented, or left alone.