Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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 you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Quote:
Then the entries in /etc/passwd would still be valid.
Well, the way I proposed would satisfy that need...
Quote:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.