[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Anzahl der login Fehlversuche begrenzen



Hallo,

ich möchte auf einem Debian stable die Anzahl der fehlgeschlagenen
Loginversuche auf fünf begrenzen.  Ich habe zu dem Problem Antworten
im Netz gefunden, die von 2010 sind:

go to --- /etc/pam.d/system-auth
append auth required pam_tally.so onerr=fail deny=5 unlock_time=21600

Where,
(a) deny=5 - Deny access if tally for this user exceeds 5 times.

(b) unlock_time=21600 - Allow access after 21600 seconds(6 hours) 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.

(c) onerr=fail - If something weird happens(like unable to open the file), return with PAM_SUCESS if onerr=succeed is given, else with the corresponding PAM error code.

Das deckt sich mit der PAM doku, die ich gefunden habe[1].

Da es auf meinem Jessie System kein /etc/pam.d/system-auth gibt: Ist die
Antwort heutzutage noch korrekt und sollte ich die Datei einfach
anlegen, oder füge ich das besser an /etc/pam.d/common-auth an?  Die
Doku bezieht sich explizit auf Redhat Systeme.

Ich habe jedenfalls mal folgende Änderung gemacht:

:/etc/pam.d# git diff
diff --git a/pam.d/common-auth b/pam.d/common-auth
index 5265ebc..9a417ef 100644
--- a/pam.d/common-auth
+++ b/pam.d/common-auth
@@ -26,3 +26,8 @@ auth  required                        pam_permit.so
 # and here are more per-package modules (the "Additional" block)
 auth   optional        pam_mount.so 
 # end of pam-auth-update config
+#
+# 2015-12-03:at: Lock account for 6h after 5 failed login attemts
+#   see http://www.linuxforums.org/forum/security/632-number-login-attempts-linux.html
+#   and http://www.rackspace.com/knowledge_center/article/using-pam-to-manage-accounts#2
+append auth required pam_tally.so onerr=fail deny=5 unlock_time=21600


Nun müßte ich laut doku pam-auth-update aufrufen:

# pam-auth-update

pam-auth-update: Local modifications to /etc/pam.d/common-*, not updating.
pam-auth-update: Run pam-auth-update --force to override.


Fragen:

  1. Ist die Änderung im Debian-Sinne sinnvoll?
  2. Ist es korrekt, daß ich nun pam-auth-update --force
     aufrufen muß oder kann man das eleganter machen?

Viele Grüße

       Andreas.

[1] http://www.rackspace.com/knowledge_center/article/using-pam-to-manage-accounts#2

-- 
http://fam-tille.de


Reply to: