On Red Hat Linux, how can a particular account be restricted to logging in with a particular window manager? For example, only fvwm2 is allowed but KDE and GNOME are not. Or can the disallowed window managers be forced to exit?
migrated from stackoverflow.com Dec 20 '09 at 22:57
The only way I can think to do this involves using groups. You would set up groups that correspond to each window manager and add an account to the groups of the window manager (or managers) of choice. Change the group owner of each window manager to the corresponding group. Remove permissions for "other" to execute the different window managers. Now, in order to start a window manager, you will need to have permission to execute it. Since you only have permission to execute the window managers that correspond to your group membership, you can make it so that particular users can only execute certain window managers.
This actually seems very hard to maintain and not particularly scalable and I wouldn't recommend it. You might just as well configure the account with an alias for the "correct" window manager and ask your users to invoke the window manager via the alias instead. It won't stop a determined user, but might accomplish most of what you want without the complications of maintaining the groups.
Perhaps what you really want is to limit the (virtual) memory or other resources that they can use. If so see the
Colleagues of mine found the following solution:
.dmrc should be
.Xclients-default, .xinitrc, and .xsessions should have
gnome-login-script should be
kde-login-script should be
Modify /etc/X11/gdm/gdm.conf so it specifies
Add to ~lcsoper/.bash_profile:
to terminate the session if something other than the default was selected. As long as the user can't change shells or modify .bashrc, then only the "default" window manager can run.