Is it possible to lock some accounts in order to be accessible only during specific time periods?
For instance the account joe should only be accessible during office hours.
Is it possible to lock some accounts in order to be accessible only during specific time periods?
For instance the account joe should only be accessible during office hours.
If you are talking about Linux, it depends if the distro ships pam_time.so or not. That PAM module can support limiting access to certain times of day, with user exceptions, fully looped into the PAM stack.
For other *NIX, if they support PAM (like Solaris) you can probably get and compile pam_time.so from somewhere.
In FreeBSD you can use the pw
utility:
pw lock <user>
and
pw unlock <user>
So now all you have to do is create a script to add logout
and kill
commands as required, loop through the users, execute via cron
job and you're done!