ID #1157

Benutzerpasswörter gegen Wörterbuchattacken schützen

Um sicherzustellen das ein Benutzerpasswort sich nicht so leicht zu erraten ist, kann man dieses unter Linux mit dem PAM-Modul pam_cracklib.so überprüfen. Es wird getestet wie leicht oder schwer das Passwort mit einer Wörterbuchattacke zu knacken ist. Dem User ist es nicht erlaubt ein neues Passwort zu setzen, wenn die Bedingungen nicht erfüllt sind (d.h. ein schwaches Passwort ist nicht erlaubt).


Zuerst muss das libpam-cracklib PAM Modul installiert werden, um die Cracklib Unterstützung zu aktivieren.

# apt-get install libpam-cracklib

Nun doe Konfigurationsdatei öffnen:

# vi /etc/pam.d/system-auth

Folgende Zeile abändern oder einfügen:

password required pam_cracklib.so retry=2 minlen=10 difok=6

Nun die Datei abspeichern und schließen.


Syntax

  • retry=2 : Prompt user at most 2 times before returning with error
  • minlen=10 : minimum length allowed for an account password is set to 10 characters. This is the minimum simplicity count for a good password. And you are allowed only 2 times using retry option.
  • difok=6: How many characters can be the same in the new password relative to the old. User will see error - BAD PASSWORD: is too similar to the old one
  • You can also apply following options to compute the 'unsimplicity' of the password.
    • dcredit=N : Digits characters
    • ucredit=N : Upper characters
    • lcredit=N : Lower characters
    • ocredit=N : Other characters

Please note that restrictions are only applied to normal users (not to root user).

Tags: Benutzerpasswort, Cracklib, PAM-Modul, Wörterbuchattacke

Related entries:

You can comment this FAQ