23 January 2008

How to Limit user access based on timings in Linux

To limit the access to a Linux operating
system in a time range, you would like to use pam_time.so.

1.Open the file /etc/security/time.conf

Format of the file is:
Service;ttys;users;time
To limit ssh access from 23:00 PM and 08:00 AM.

sshd;*;*;!Al2300-0800

the !Al means, anything except "All the days".

To permit people from 4 to 8 PM all the days, except root:
login;*;!root;!Al1600-2000

No comments: