Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If this is already covered than I apologize in advance.
I have recently joined an 11.04 server to an AD and want to configure home directories based on group membership for all AD users that login. Basically, I want one home directory for "Domain Users" and another for "Domain Admins".
Not impossible...and easily done. I'd provide a symlink to a common folder per user. Package that in a script that wraps useradd, it checks what group (reads the command line) is used and sets up a symlink in the newly made folder of that user.
I suspect a small PERL script should do it...
If need be, I'll meditate on it, but it can be done...
Could the symbolic link replace the existing user's home directory but have the same name? Then the entries in /etc/passwd would still be valid. Access to the new folder would be based on group membership. Is there a way to run it the first time a user logs in?
Could the symbolic link replace the existing user's home directory but have the same name?
I suspect so, but that would not be very practical. For one, you'll not be able to keep the individual users apart. Each user with its folder, and a symlink in that folder allows you ro keep fine-grained control of the users.
Then the entries in /etc/passwd would still be valid.
Well, the way I proposed would satisfy that need...
Access to the new folder would be based on group membership. Is there a way to run it the first time a user logs in?
The chmod command already caters for this...I think...
I think you'd be best served with a PERL wrapper around adduser...just how good is your PERL?
Unfortunately I have little experience in perl beyond reading scripts to figure out what they do. I have never written anything in perl. I have in shell, python, expect and taken some first level C++ courses.
I am hoping to run it on the user's first login only for obvious reasons.