You are not logged in.
There are various how-to's on other sites with solutions to this problem, but Arch's implementaton of pam seems divergent enough that I can't get those solutions to work.
My elementary-school-age kids have accounts on a computer for school, but I have found that they will be on at 5:00am to goof around. I want to restrict their access to the computer on weekdays and weekends with separate schedules.
One computer, running Ubuntu, is able to accomplish this by changing the following files with the following lines:
/etc/pam.d/common-auth:
account required pam_time.so
and then by adding a line to /etc/security/time.conf to actually enforce the curfews:
*;*;school;Wd0800-1800# login to school account (no games) is allowed on weekdays between 8:00am and 6:00pm
*;*;kids;Wd1500-1800 #login to kids entertainment account is allowed on weekdays between 3:00pm and 6:00pm
*;*;school,kids;Sa1100-1800#both accounts are disallowed on Saturday before 11:00am and after 6:00pm
On Ubuntu, this is working perfectly, because it has /etc/pam.d/common-auth
Arch linux has no such file, and I've tried putting this line in several other files to accomplish this. I've also tried using this to restrict a user's access to a particular program (supertux2) to a certain time frame.
Here are the pam.d modules I have to work with:
$ ls /etc/pam.d
chage
chsh
groupdel
login
passwd
runuser
sddm-autologin
slimlock
su-l
system-local-login
useradd
chfn
cinnamon-screensaver
groupmems
lxdm
polkit-1
runuser-l
sddm-greeter
sshd
supertux2
system-login
userdel
chgpasswd
cups
groupmod
newusers
rlogin
samba
shadow
su
system-auth
system-remote-login
usermod
chpasswd
groupadd
kde
other
rsh
sddm
slim
sudo
systemd-user
system-services
xdm
I use LXDM as my desktop manager and KDE as the desktop environment
I've tried appending "account required pam_time.so" to the following files in /etc/pam.d without success (again, no common-auth on my system):
kde
login
lxdm
system-auth
system-local-login
I've been banging my head against this wall for a couple of weeks now without getting anywhere, and every time I find my kids awake and playing games at some ungodly hour of the morning, it makes this topic increasingly urgent for me. All suggestions are appreciated. Thanks!
Last edited by jdoggsc (2020-08-15 20:58:43)
Offline
There's a sytax error, should be "school|kids".
pam_time is already required in system-auth.
Did you establish "does not work" because you tried or because your offspring is still able to game the system?
Online
Hey Seth,
Thanks for taking the time to investigate this with me. I corrected the typo. Turns out that's not the only problem. I used Wd to mean weekday. Today being a weekend I tried logging in with the school account expecting to be blocked, but was able to log in. Turns out Wk is weekday and Wd is weekend. I corrected that, and now it works as intended.
Such a simple thing...
Thanks for your help.
Offline