pam_tally2의 설명은 각 cat /usr/share/doc/pam-x.x.x/txts/README.pam_tally2 에 들어있다.
[test@localhost ~]$ cat /usr/share/doc/pam-1.1.8/txts/README.pam_tally2
pam_tally2 — The login counter (tallying) module
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DESCRIPTION
This module maintains a count of attempted accesses, can reset count on
success, can deny access if too many attempts fail.
▶ 설명
이 모듈은 시도된 액세스 횟수를 유지하고, 성공시에 초기화되며, 로그인 시도가 너무 많이 실패하면 접근이 거부될
수 있다.
pam_tally2 comes in two parts: pam_tally2.so and pam_tally2.
The former is the PAM module and the latter, a stand-alone program.
pam_tally2 is an (optional) application which can be used to interrogate and manipulate the counter file.
It can display users' counts, set individual counts, or clear all counts.
Setting artificially high counts may be useful for blocking users without changing their passwords.
For example, one might find it useful to clear all counts every midnight from a cron job.
▶ pam_tally2는 pam_tally2.so 와 pam_tally2 두 부분으로 나뉜다.
pam_tally2.so는 PAM 모듈이고, pam_tally2는 독립 프로그램이다.
pam_tall2는 카운터파일을 조회, 조작 하는데 사용되는 (옵션)어플리케이션이다.
사용자 수를 표시하거나, 개별 카운트를 설정하거나, 모든 카운트를 지울 수 있다.
인위적으로 높은 카운트를 설정하여 패스워드 변경 없이 사용자를 차단하는데 유용할 수 있다.
예를 들어, 매일 밤 크론 작업(예약 작업)을 통해 모든 카운트를 지우는 것이 유용할 수 있다.
Normally, failed attempts to access root will not cause the root account to become blocked, to prevent denial-of-service: if your users aren't given shell accounts and root may only login via su or at the machine console
(not telnet/ rsh, etc), this is safe.
▶ 일반적으로, 루트 계정은 접속이 실패해도 차단되지 않으며, 서비스 거부(DoS)를 방지하지 못한다.
만약 사용자들에게 셸 계정을 주지 않고, 오직 콘솔 접속 또는 su를 통해 root로 접속하는 경우 해당 설정은 안전하다.
OPTIONS
GLOBAL OPTIONS
This can be used for auth and account module types.
▶ 옵션
글로벌 옵션들
- <auth, account> 모듈 타입에서 사용할 수 있다.
onerr=[fail|succeed]
If something weird happens (like unable to open the file), return with
PAM_SUCCESS if onerr=succeed is given, else with the corresponding PAM
error code.
▶ onerr=[fail|succeed]
뭔가 이상한 일(파일을 열수 없는 것 같은)이 발생하는 경우, onerr가 succeed로 설정되었다면 PAM_SUCCESS를
반환하고 그렇지 않다면(onerr가 fail로 설정되었다면) 해당하는 PAM error코드를 반환한다.
file=/path/to/counter
File where to keep counts. Default is /var/log/tallylog.
▶ file=/path/to/counter
카운트를 저장할 파일. 기본값은 /var/log/tallylog입니다.
audit
Will log the user name into the system log if the user is not found.
▶ audit
유저를 찾을 수 없는 경우 시스템 로그에 유저명을 기록합니다.
silent
Don't print informative messages.
▶ silent
메시지를 출력하지 않음
no_log_info
Don't log informative messages via syslog(3).
▶ no_log_info
syslog를 통해 로그를 남기지 않음
AUTH OPTIONS
Authentication phase first increments attempted login counter and checks if
user should be denied access. If the user is authenticated and the login
process continues on call to pam_setcred(3) it resets the attempts counter.
▶ <auth>옵션
인증 단계에서는 먼저 시도된 로그인 카운터를 증가시키고, 사용자가 차단되어야 하는지를 확인한다.
만약 사용자가 인증되고 로그인이 진행되면, pam_setcred (3)를 호출하고(사용자 자격증명을 설정한다는 뜻인듯),
시도 카운터를 초기화한다.
(pam_setcred (3) : 사용자 자격 증명을 설정 / 삭제합니다.)
deny=n
Deny access if tally for this user exceeds n.
▶ deny=n
n을 초과하는 접근시 차단 (접속 실패 횟수 설정)
lock_time=n
Always deny for n seconds after failed attempt.
▶ lock_time=n
시도 실패 후 항상 n 초 동안 차단 (1회 실패시 차단 시간 설정인듯)
unlock_time=n
Allow access after n seconds after failed attempt. If this option is
used the user will be locked out for the specified amount of time after
he exceeded his maximum allowed attempts. Otherwise the account is
locked until the lock is removed by a manual intervention of the system
administrator.
▶ unlock_time=n
시도 실패 후 n 초 후에 접근 허용. 이 옵션 사용시 사용자가 최대 허용 횟수(deny=n)를 초과한 후 n 초 동안 잠근다.
그렇지 않으면 해당 계정은 시스템 관리자를 통해 수동으로 해제될 때까지 잠긴다.
magic_root
If the module is invoked by a user with uid=0 the counter is not
incremented. The sysadmin should use this for user launched services,
like su, otherwise this argument should be omitted.
▶ magic_root
uid가 0인 계정에 의해 모듈이 호출되는 경우 카운트가 증가하지 않는다. sysadmin의 경우 (su와 같은) 사용자가
시작한 서비스에 대해 해당 설정을 사용해야함, 그렇지 않으면 해당 인수(magic_root)를 생략해야 한다.
even_deny_root
Root account can become unavailable.
▶ even_deny_root
root도 사용불가 될 수 있음
root_unlock_time=n
This option implies even_deny_root option. Allow access after n seconds
to root account after failed attempt. If this option is used the root
user will be locked out for the specified amount of time after he
exceeded his maximum allowed attempts.
▶ root_unlock_time=n
이 옵션은 even_deny_root를 의미한다. 시도 실패 후 루트 계정으로 n초 후에 접근을 허용함.
이 옵션을 사용할 경우 루트 사용자는 허용된 최대 시도 횟수 초과 후 지정된 시간동안 잠긴다.
serialize
Serialize access to the tally file using locks. This option might be
used only for non-multithreaded services because it depends on the
fcntl locking of the tally file. Also it is a good idea to use this
option only in such configurations where the time between auth phase
and account or setcred phase is not dependent on the authenticating
client. Otherwise the authenticating client will be able to prevent
simultaneous authentications by the same user by simply artificially
prolonging the time the file record lock is held.
▶ serialize
serialize는 잠금을 통해 tally file에 접근한다. 이 옵션은 tally파일의 fcntl 잠금에 의존하기 때문에 잠금다중읽기가
아닌 서비스에만 적용될 수 있다. 또한 인증 단계와 계정/자격증명설정 단계 사이의 시간차이가 인증 클라이언트에
따라 달라지지 않는 구성에서만 이 옵션을 사용하는 것이 좋다.
그렇지 않으면, 인증 클라이언트는 단순히 인위적으로 파일 레코드가 잠겨있는 시간을 연장함으로써 동일한 유저에
의한 동시 인증을 막을 수도 있을 것이다.
ACCOUNT OPTIONS
Account phase resets attempts counter if the user is not magic root. This
phase can be used optionally for services which don't call pam_setcred(3)
correctly or if the reset should be done regardless of the failure of the
account phase of other modules.
▶ <account>옵션
account 단계는 사용자가 magic root가 아닌 경우 시도 카운터를 초기화한다. 이 단계는 pam_setcred(3)를 올바르게
호출하지 않거나 다른 모듈의 account 단계의 실패와 상관 없이 재설정이 수행되어야 하는 경우에 선택적으로 사용
할 수 있다.
magic_root
If the module is invoked by a user with uid=0 the counter is not
changed. The sysadmin should use this for user launched services, like
su, otherwise this argument should be omitted.
▶ magic_root
uid가 0인 계정에 의해 모듈이 호출되는 경우 카운트가 증가하지 않는다. sysadmin의 경우 (su와 같은) 사용자가
시작한 서비스에 대해 해당 설정을 사용해야함, 그렇지 않으면 해당 인수(magic_root)를 생략해야 한다.
NOTES
pam_tally2 is not compatible with the old pam_tally faillog file format. This
is caused by requirement of compatibility of the tallylog file format between
32bit and 64bit architectures on multiarch systems.
There is no setuid wrapper for access to the data file such as when the
pam_tally2.so module is called from xscreensaver. As this would make it
impossible to share PAM configuration with such services the following
workaround is used: If the data file cannot be opened because of insufficient
permissions (EACCES) the module returns PAM_IGNORE.
▶ 알림
pam_tally2는 이전 pam_tally faillog 파일 형식과 호환되지 않는다. 이것은 multiarch 시스템에서 32비트와 64비트 아키텍처 사이의 tallylog 파일 형식의 호환성 요구사항에 의해 야기된다. (비트수가 달라서 안된다는 얘기인듯)
pam_tally2.so 모듈이 xscreensaver에서 호출될 때 처럼 데이터파일에 액세스 할 수 있는 setuid wrapper는 없다.
이렇게 하면 PAM 구성을 해당 서비스와 공유할 수 없으므로 다음과 같이 하십시오.
사용권한이 부족하여 데이터 파일이 열리지 않는다면 모듈이 PAM_IGNORE를 반환.
EXAMPLES
Add the following line to /etc/pam.d/login to lock the account after 4 failed
logins. Root account will be locked as well. The accounts will be automatically
unlocked after 20 minutes. The module does not have to be called in the account
phase because the login calls pam_setcred(3) correctly.
▶ 예시
/etc/pam.d/login에 다음 줄을 추가하여 4회 로그인 실패시 잠김 설정을 한다.
root 계정도 잠길 것이다.(even_deny_root 가 있으므로)
20분 후에 계정 잠김이 자동으로 해제될 것이다.
로그인 시 pam_setcred(3)을 올바르게 호출하기 때문에 account 단계에서 모듈을 호출할 필요가 없다.
auth required pam_securetty.so
auth required pam_tally2.so deny=4 even_deny_root unlock_time=1200
auth required pam_env.so
auth required pam_unix.so
auth required pam_nologin.so
account required pam_unix.so
password required pam_unix.so
session required pam_limits.so
session required pam_unix.so
session required pam_lastlog.so nowtmp
session optional pam_mail.so standard
AUTHOR
pam_tally2 was written by Tim Baverstock and Tomas Mraz.