This problem has been bogging me for a few days now and I guess I should ask about it before either the wall or my head shatter (and that would certainly be the latter).
I need to prevent all screen-locking capabilities for all users (possibly excepting admins, but not necessarily). What I have found so far is a weird but convenient tweak:
chown rootlocal.admins /usr/bin/xflock4 chmod 770 /usr/bin/xflock4
Where rootlocal is the local sudoer account and admins is the group of administrators accounts stored in the LDAP server.
I first thought it worked like a charm, but only to realize it couldn't prevent the system to wake up locked after sleep or hibernation. So I need either to remove sleeping and hibernation from the equation (but I'm not sure how to do that properly) or, preferably, to prevent screen-locking when they occur. This is for classrooms system, and I don't want students to lock computers all the time.
Note: I'm running Ubuntu 12.04 with xubuntu-desktop installed and session of "Xubuntu" type, but it is not impossible to switch to something else if needed or more convenient. However, the point is I have all install procedures ready for professional applications and the desktop environment is the last thing I have to configure.
Any help appreciated.
xflock4 just calls one of the following screensaver/locker: xscreensaver, gnome-screensaver, xlock, slock. If you remove those packages from your system, screen locking is gone.
Alternatively you could modify xflock4 (it's a shell script) to check the user id before calling the screensaver/locker.
I had not even thought of reading the content of xflock4. Don't even know why I was so sure it was a binary. Anyway, I've applied the same treatment to these files (chown + chmod), and as far as I can tell after some quick testing... It works!
Thank you very much.
Edit: As far as editing xflock4 is concerned, I would rather do that on a copy named /usr/local/bin/xflock4, leaving the original untouched. Default PATH checks /usr/local/bin/ before /usr/bin/, so it would work as long as you do not change the order. This is just a side note, since I apparently do not need to edit it.
Last edited by N-t-F (2012-07-17 16:38:14)