How to Restrict user login after certain time in Solaris??

My OS is Solaris 10, I would like to know if there is any way to restrict user login to the system (either remote or console login) after certain time, say 20:00 on Mon to Fri and whole day on SAT and SUN???

Sorry that I am a new user on Unix System.

Any comment is fully appreciated!!!

Alex

There is no built in mechanism for that in Solaris. Linux comes with a PAM module named pam_time, but I could not find a Solaris port.

so are there any plug-in module I can find ???

Sorry, I am not aware of any precompiled module for solaris.

I guess you may use crontabs for this.

Thanks for your reply, but would you please give me more details ???

A wild thinking!!!

How about playing around /etc/passwd file for example say 20:00 on Mon to Fri and whole day on SAT and SUN you can replace or comment the line in /etc/passwd. Schedule a script which can perform the task and once through every morning removed the replace the file with actual one or remove the cooment line from /etc/passwd!!!!!

If you want to block everyone from accessing a system after a specified time, you need to create a /etc/nologin file at that exact time. The file has to be removed at the time you want to allow access to the system. This can be achieved through a crontabs

Type crontab -e while logged in as root and add these lines on the files...

# Block access at 8:00PM from Mon-Fri
00 20 * * 1,2,3,4,5 touch /etc/nologin

# Open access at 8:00 AM from Mon-Fri
00 08 * * 1,2,3,4,5 rm -rf /etc/nologin

and save the file, This will install the cron.

Thanks,
-Raja