setting time restrictions for me and my girlfriend
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
setting time restrictions for me and my girlfriend
Since using the computer has become an addiction for me and my partner we need time restrictions.
I feel like a dumb newbie because I have not succeeded in making it work, so I post it here. I have been using Linux quite a bit longer than a newbie. I am not very advanced in using it but still know my way around and can use cli if it's not too complicated.
I have added the to the bottom of /etc/gdm3
account required pam_time.so
to make gdm(3) login manager use time restrictions
that I can define in the next file
I added the following to it.
that should disable all services,
all tty's (and gdm to because of what I did to /etc/gdm3)
all days of the week A1
from 0000 till 0800 hours
(one can exceed the time limit but one cannot
login after this time (see below).
When testing it that same evening
I could not login as a normal user anymore through gdm
so I thought that part at least did work.
(root login on the terminal still worked,
and that should also be disabled,
but not until after the issues are fixed)
But the next morning after 0800 I could not login through gdm,
while that should now be possible.
How do I fix this ?
I also made a cronjob to shut down the system
because when you exceed this time limit there is only
something mentioned in the syslog that you exceeded your limit
but it does not automatically logout the user.
Only when reentering the system I get the message permission denied.
crontab -e -u root
added this to the bottom of the crontab
55 23 * * * shutdown -h 5 now
But on both our systems the cronjob does not run
So it does not automatically shutdown.
There fore the time limiting also does not work.
We run Debian Linux.
I also tried to make a warning message appear
on X (windows) but I will open another thread for that
and post a link to that in this one for completeness
I apologize for any language mistakes because
English is not my native speech.
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
I'm not sure why you wouldn't be allowed to log back in at 0800. (Caveat: I haven't used this feature on Linux but I know it works on other UNIX-variants.) Check the settings to be sure you have the time correctly defined. Specifically, check out the possible need for a "!" character in the time specification. You're right, though... that won't kick you out when the restricted window begins; only new logins would be prohibited.
Rebooting to kick everyone out seems a little draconian.
Perhaps you could set up a little utility that runs in the background when you log in that periodically checks to see how long you've been logged on and, if it's longer than your desired duration or outside of the window you want to allow, starts popping up an "xmessage" window every few minutes that says something like: "Hey! You've been logged in long enough! Get a life!" with options to click on "OK, I'll get off now." or "Go away, I'm having too much fun." options and log which one you clicked on. (Then you and your SO can compare log files so you can see how the other is handling their Internet addiction.)
Last edited by rnturn; 04-03-2013 at 03:29 PM.
Reason: Forgot comment about the "!" character in the PAM time filter.
The login problem
in the morning after 0800
is probably a bug somewhere.
I don't know if it is a Debian problem
or something in Linux in general.
I hope it is resolved soon.
If so I will post here again.