Solved

Timer program

Posted on 2000-03-01
7
238 Views
Last Modified: 2013-12-16
Hi There
I need to get hold of a program or script that will allow a user a set amount of time
0
Comment
Question by:will_do
7 Comments
 
LVL 2

Expert Comment

by:joe_h
ID: 2580337
what exactly do you mean? Something that logs the user out if he/she has been logged in for too long?
0
 

Author Comment

by:will_do
ID: 2581350
something that i can put block of hours into and thats all the users can use
0
 
LVL 2

Expert Comment

by:joe_h
ID: 2586876
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:will_do
ID: 2586890
the hourly accounts are only for some ppl most of the account will be unlimited
0
 
LVL 4

Expert Comment

by:kiffney
ID: 2597340
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
 
LVL 2

Expert Comment

by:joe_h
ID: 2597473
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
 
LVL 1

Accepted Solution

by:
hbrady earned 50 total points
ID: 2604438
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now