Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time restricting login

Status
Not open for further replies.

unixfreak

ISP
Joined
Oct 4, 2003
Messages
632
Location
GB

Hi, I've been asked to make a user only available for login between 9 and 5pm and have looked at different options.

The PAM module for this seems to be quite complicated to install on Solaris?

I considered a cronjob instead but locking and unlocking accounts are not easily done in Solaris.

Has anyone succesfully done this before? Unfortunately installing AIX is not an option.
 
PAM modules aren't very difficult to install??

Another option is to modify /etc/profile to check the whether the current time is in the range, and if not, just echo a message and exit. Also make sure it only acts on the correct group of users (consider having them all part of a particular group perhaps) so that you can still log in yourself.

Annihilannic.
 
Do you intend to automatically log the user out if they are still using the system after 5pm?

A simple way would be to add and exit onto the last line of their .profile, then use cron to move the altered .profile in and out.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 

We wouldn't really be interested in kicked the user out, just denying login.

The PAM time module isn't readily available for Solaris and very hairy to compile/install. If you know otherwise please do let me know!

Thanks for your input though. We could also copy the passwd file with a cronjob maybe?
 
I wouldn't be tempted to move the passwd file. If it goes wrong it goes wrong for everyone.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top