Lock the Computer over Night and on Weekends
Solution 1:
pam_time
is the built-in way to restrict access based on time. It can prevent logins, but existing sessions would continue. Otherwise, people seem to script their own solutions.
Links
- How do I restrict my kids' computing time?
- Log on hours for users
- How can I allow access to SSH only at a specific time?
- How to lock yourself out of the primary account temporarily?
- how to restrict time used for using computer in Ubuntu
- http://manpages.ubuntu.com/manpages/focal/en/man8/pam_time.8.html