Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

Timer program

Hi There
I need to get hold of a program or script that will allow a user a set amount of time
0
will_do
Asked:
will_do
1 Solution
 
joe_hCommented:
what exactly do you mean? Something that logs the user out if he/she has been logged in for too long?
0
 
will_doAuthor Commented:
something that i can put block of hours into and thats all the users can use
0
 
joe_hCommented:
If you need to set the same hours for all users, you can place a SCHED=... option to the appropriate /etc/default/getty.something or /etc/default/getty file. (details - man getty :)
Another option would be to have getty run a different program than the default /bin/login - perhaps a script, that would find the user name in a list of allowed hours, compare that to the current time and either call the original /bin/login or die.
Anyway, I'm sure somebody has already written such a script, but I didn't come across it yet.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
will_doAuthor Commented:
the hourly accounts are only for some ppl most of the account will be unlimited
0
 
kiffneyCommented:
The only way I can think to do it would be to write a script run by a cron job that parses the output of 'who' (which shows you who is logged in, and what time they logged in), checked for the users you wanted to limit, figured out if they were over limit, then kicked them off.  I've done something similar for dialin users who were using remote file mounts, but it wouldn't work for this project.  Such software must exist, however.  You might find something that would do this for you as a utility inside some BBS or ISP software for Linux.  Check on www.freshmeat.net or www.google.com.
0
 
joe_hCommented:
I think we are on a good track here. Probably we'd use two components:
1. a script invoked via the getty/login mechanism that would allow the user to log-on only during the specified hours.
2. a cron-invoked script that would kick off any users who have exceeded their hours.

As kiffney suggested, I'd also recommend searching www.freshmeat.net, www.redhat.com, etc. As the last resort we can try to write this; however, I dislike re-inventing the wheel.
0
 
hbradyCommented:
There is actually a powerful package available to do just what you are looking for.  It's called clobberd and it works very well.  You can find it on the RedHat Powertools CD or
you can do a search for it at http://www.tuxfinder.com/

Once you have installed it start the daemon by running "clobberd".  Then run "clobberd localhost" to edit users, restrictions etc.  BTW, the default password is honda.

Have fun.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now