Consulte Restringir o acesso dos usuários aos sistemas Linux .
A idéia é usar Linux-PAM para controlar o acesso cronometrado de usuários a serviços:
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
- The first field — services — is a logic list of PAM service names.
- The second field — tty — is a logic list of terminal names.
- The third field — users — is a logic list of users or a netgroup of users.
- 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.