Time.conf & Crontab setup

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
JAnthony419
Level 1
Level 1
Posts: 5
Joined: Sat Jan 03, 2015 6:02 pm

Time.conf & Crontab setup

Post by JAnthony419 » Sat Jan 03, 2015 6:21 pm

Time.conf
login;*;user;Al0000-1200|Al1800-2400
games;*;user;Wk0000-2400|Wd0000-1200|Wd1500-2400
login;*;root;Al0000-2400

Crontab
05 18 * * * user logout

The purpose of this to disallow my children to login between 0000-1200, and 1800-2400 daily, and if they are logged in already to log them out NLT 1805. What all would I need to configure to accomplish this, or is it just these two files. And are these lines of code written correctly or do they need so tweeks?

User avatar
WharfRat
Level 21
Level 21
Posts: 13073
Joined: Thu Apr 07, 2011 8:15 pm

Re: Time.conf & Crontab setup

Post by WharfRat » Sat Jan 03, 2015 9:09 pm

I think you would want to prevent the X session from starting so try

x-session-manager;tty*;kid1|kid2;Al0000-1200|Al1800-2400

As far as the crontab goes, there's no simple logout directive so you might have to force a reboot

05 18 * * * shutdown -r now

Maybe someone else will have better ideas .

Good luck :wink:
ImageImage

User avatar
JAnthony419
Level 1
Level 1
Posts: 5
Joined: Sat Jan 03, 2015 6:02 pm

Re: Time.conf & Crontab setup

Post by JAnthony419 » Sun Jan 04, 2015 5:03 am

x-session-manager;tty*;kid1|kid2;Al0000-1200|Al1800-2400
Where would I place this script at, inside of what file?, or does it go in the crontab as well? :?:

User avatar
WharfRat
Level 21
Level 21
Posts: 13073
Joined: Thu Apr 07, 2011 8:15 pm

Re: Time.conf & Crontab setup

Post by WharfRat » Sun Jan 04, 2015 9:49 am

JAnthony419 wrote:
x-session-manager;tty*;kid1|kid2;Al0000-1200|Al1800-2400
Where would I place this script at, inside of what file?, or does it go in the crontab as well? :?:
Place it at the end of /etc/security/time.conf
ImageImage

Post Reply

Return to “Newbie Questions”