|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Saad Kadhi (bsdguy
docisland.org)Date: Wed May 01 2002 - 13:12:58 CDT
On Wed, 2002-05-01 at 01:20, dweise wrote:
> Hello,
> Is there anyway to set time restrictions for users on Solaris 8? (Other
> NOS that can do this is Novell) For Example: Set user bsombdy account so
> that they can log on from 8am to 6pm.
You can force *all* users to log from 8am to 6pm by creating (via cron
for example) /etc/nologin at 6:01pm and deleting it at 7:59am.
Otherwise, you can cook very easily a small script that will change the
shell field of users to /bin/false in /etc/passwd for example at 6:01pm
each day and restoring their normal shell at 7:59am. It can read its
input from a file that contains sth like :
# user mintime maxtime
foo 8:00am 6:00pm
bar 7:00am 10:00pm
...
but note that in both approaches, once a user is logged then the system
won't kick them at 6:00pm (if this is their maxtime). But there are ways
to do that (killing the user shell for example but this is not really
clean)
HTH
-- Saad -- [pgp keyid: 35592A6D http://pgp.mit.edu] [pgp fingerprint: BF7D D73E 1FCF 4B4F AF63 65EB 34F1 DBBF 3559 2A6D] # booth slave for hire
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]