Linux timed access

Sat 01 Jun 2019

Sometimes you just want to restrict users from using the system at certain times in the week ;-) It’s all there when using PAM, you just need to find it.

For the specific PAM services see $ ls /etc/pam.d/

Limiting access to eg lightdm in 2 steps:

  1. add to /etc/pam.d/lightdm
    # /etc/pam.d/lightdm
    account required pam_time.so
  2. edit /etc/security/time.conf
    and add:
    ```
    #services;ttys;users;times

;;;Al1200-2130

which will block access to all services which require `pam_time.so` outside of 12:00 and 21:30 time window.

More info and how to set the see: [linux-pam](http://www.linux-pam.org/Linux-PAM-html/sag-pam_time.html)