How to restrict use of a computer?

3

Suppose that some person is insomniac because of a bad habit of chatting on the IRC every night until 3AM. That completely ruins this person's life because he is unable to wake up on time to attend his exams, because he will be fully exhausted everyday and will feel depressive.

That person is conscious of this bad behaviour, and would accept any help including installing a software on his own computer granting me admin privileges to install it.

Do you know of such a software that ideally would:

  • Would prevent use of the computer at certain time ranges, let's say 11PM — 6AM
  • Would gracefully shutdown the computer at the beginning of that time range (not killing all the applications brutally), and shutdown it if the user attempts to switch it back on
  • Would warn 10 minutes beforehand
  • Could occasionally be disabled if I give a one-time password to that person?

That person uses Linux, and I am curious of knowing what is available for that purpose. It is kind of a parental control, but not for a child.

Thank you for your advice.

Benoit

Posted 2010-11-22T20:35:46.600

Reputation: 6 563

Answers

3

See Restrict users' access on Linux systems.

The idea is to use Linux-PAM to control timed access for users to services:

Using the pam_time module, we can set access restrictions to a system and/or specific applications at various times of the day as well as on specific days or over various terminal lines. Depending on the configuration, you can use this module to deny access to individual users based on their name, the time of day, the day of week, the service they’re applying for, and their terminal from which they’re making the request.

In the file /etc/security/time.conf, here’s the syntax for a rule:

services;ttys;users;times

  1. The first field — services — is a logic list of PAM service names.
  2. The second field — tty — is a logic list of terminal names.
  3. The third field — users — is a logic list of users or a netgroup of users.
  4. The fourth field — times — indicates the applicable times.

Here’s an example of a typical set of rules:

login ; * ; !bobby ; MoTuWeThFr0800-2000
login ; * ; !root ; !Al0000-2400
http ; * ; !bobby ; MoTuWeThFr0800-2000
http ; * ; !root; !Al0000-2400

These rules restrict user bobby from logging on between the hours of 0800 and 2000, and they also restrict Internet access during these hours. Root would be able to logon at any time and browse the Internet during all times as well.

harrymc

Posted 2010-11-22T20:35:46.600

Reputation: 306 093

1

The easiest way (I love the KISS Principle) would be to have someone at the house (roomate, family member, etc) unplug the router, and place the power cord in their room at night. (or just put the router in that room, and an 'easy to use with your toe' powerstrip.

There are also other parental controls software (with different levels of success) available for linux. Just make sure to not tell them the password.. (of course, if they have root....)

Brian

Posted 2010-11-22T20:35:46.600

Reputation: 2 934