LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   how can I limit time access with pam (https://www.linuxquestions.org/questions/linux-security-4/how-can-i-limit-time-access-with-pam-380907/)

hichem 11-07-2005 05:24 PM

how can I limit time access with pam
 
I want to limit access time for a user so it can't login between friday 19:00 to Monday 05:00
I tried to use the file /etc/security/time.conf but I don' know exactly how to configure it;
I tied this:
*;*;Mohamed;!Mo0000-0500&!Fr1900-2400&!SaSu0000-2400
His dosn't work exactly
so I tried this
*;*;Mohamed;!Mo0000-0500|!Fr1900-2400|!SaSu0000-2400
And I thik it dosn't work so
Kan you explain to me if we must use | (or) or & (and)

thaks

jschiwal 11-07-2005 06:27 PM

This web site seems to do a good job of explaining the syntax. Hope it helps.

jschiwal 11-07-2005 06:27 PM

This web site seems to do a good job of explaining the syntax. Hope it helps.

http://www.phptr.com/articles/articl...65226&seqNum=9

hichem 11-10-2005 12:40 PM

thanks for this link it's very good
but I don't know where is the problem :
if I write this
!Mo0000-0500&!Fr1900-2400
it works correctly (the user can't access on monday between 0000 and 0500 and have no access on friday between 1900 and 2400)

but if I add an other condition :
!Mo0000-0500&!Fr1900-2400&!SaSu0000-2400
it dosn't work

jschiwal 11-17-2005 12:58 AM

I don't know why more than two time ranges doesn't work. Perhaps you can split it into two entries. From that link:
Quote:

If there are entries that overlap, the least permissive (actually, the intersection of all entries) is used


All times are GMT -5. The time now is 04:55 AM.