nerdexam
Red_Hat

RH302 · Question #117

There are some part-time staff in your office. And you gave the username user9 and user10 to them. Their Office time is 12-2pm in Sunday, Monday and Friday. Configure to login only on their office…

Answers: 1. vi /etc/security/time.conf login;*|user9|user10;SuMoFri1200-1400 2. vi /etc/pam.d/login account required pam_time.so For Time based authentication, we should configured in /etc/security/time.conf Syntax of /etc/security/time.conf services;ttys;users;times services…

Security

Question

There are some part-time staff in your office. And you gave the username user9 and user10 to them. Their Office time is 12-2pm in Sunday, Monday and Friday. Configure to login only on their office time.

Explanation

Answers:

  1. vi /etc/security/time.conf login;*|user9|user10;SuMoFri1200-1400
  2. vi /etc/pam.d/login account required pam_time.so For Time based authentication, we should configured in /etc/security/time.conf Syntax of /etc/security/time.conf services;ttys;users;times services is a logic list of PAM service names that the rule applies to.ttys is a logic list of terminal names that this rule applies to. users is a logic list of users to whom this rule applies. times the format here is a logic list of day/time-range entries the days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday. The two character combinations accepted are Mo Tu We Th Fr Sa Su Wk Wd Al the last two being week-end days and all 7 days of the week respectively. As a final example, AlFr means all days except Friday. pam_time modules checks the file /etc/security/time.conf for authentication. So, we should call the pam_time modules in /etc/pam.d/login.

Topics

#PAM#pam_time#time-based access#login restrictions

Community Discussion

No community discussion yet for this question.

Full RH302 Practice