Ticket #2054 (closed defect: worksforme)
Ownership Not Properly Granted to LDAP Users' Home Directories
| Reported by: | michael@… | Owned by: | jsalamero@… |
|---|---|---|---|
| Milestone: | Component: | users | |
| Severity: | normal | Keywords: | ldap, ownership, owner, permission, home directory |
| Cc: |
Description
Hi, I have eBox 1.5 installed on an Ubuntu 10.04 "Lucid" server. I've installed the Users and Groups module and found that when a new user is created, a home directory is created for them, but the directory is owned by the root user, and the user cannot access it.
I've worked around this by taking creation of home directories out of the hands of ebox:
In /usr/share/perl5/EBox/UsersAndGroups.pm
Around line 107, find:
unless (-e $home) {
my @cmds = ();
push(@cmds, "cp -dR --preserve=mode /etc/skel $home");
push(@cmds, "chown -R $user:" .DEFAULTGROUP. " $home");
push(@cmds, "chmod $perms $home");
EBox::Sudo::root(@cmds);
}
Replace with:
# unless (-e $home) {
# my @cmds = ();
# push(@cmds, "cp -dR --preserve=mode /etc/skel $home");
# push(@cmds, "chown -R $user:" .DEFAULTGROUP. " $home");
# push(@cmds, "chmod $perms $home");
# EBox::Sudo::root(@cmds);
# }
In /etc/pam.d/common-session, find:
session required pam_unix.so
Below add:
session required pam_mkhomedir.so skel=/etc/skel/
When an ldap user logs in, their home directory is created with the correct permissions.
This seems like a cleaner way to handle this task, as it's standard and relies on commonly accepted methods of creating home directories rather than re-inventing the wheel.
Thanks for all your hard work on eBox.
Attachments
Change History
comment:1 Changed 3 years ago by jsoriano@…
- Status changed from new to closed
- Resolution set to worksforme
comment:2 Changed 3 years ago by michael@…
Well that's both good and bad news; good because it's working for everyone else, bad because it means something's broken on my end.
I can't find any logs of failed LDAP lookups or anything.
I'll try a complete reinstall of eBox before giving up and going with my workaround.
comment:3 Changed 3 years ago by anonymous
Confirmed, after a complete purge and reinstall, home directory ownership is still not set properly on my system.
If there are logs or settings I can copy here that would illuminate this issue at all, please let me know. For now, my workaround is workarounding.
Thanks again for all your hard work.
comment:4 Changed 2 years ago by anonymous
- Status changed from closed to reopened
- Resolution worksforme deleted
I'm suffering exactly the same problem. Has any further progress been made?
comment:5 Changed 2 years ago by jacalvo@…
- Status changed from reopened to closed
- Resolution set to worksforme
What version are you using? We can't reproduce this. If the bug is only in 1.5, we're sorry but that was a beta version and it's no longer maintained. Please if you can provide detailed steps on how to reproduce it with the last Zentyal 2.0 version.
I cannot reproduce the ownership problems, anyway we'll take into account your suggestion to use pam tools instead of our custom script for this task.
Thanks!