Solved

Timer program

Posted on 2000-03-01
7
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

697 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