浏览代码

Enforce good passwords

Bob Mottram 10 年前
父节点
当前提交
67dd6aca56
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12
    0
      install-freedombone.sh

+ 12
- 0
install-freedombone.sh 查看文件

317
   fi
317
   fi
318
 }
318
 }
319
 
319
 
320
+function enforce_good_passwords {
321
+  # because humans are generally bad at choosing passwords
322
+  if grep -Fxq "enforce_good_passwords" $COMPLETION_FILE; then
323
+      return
324
+  fi
325
+  apt-get -y --force-yes install libpam-cracklib
326
+
327
+  sed -i 's/password	requisite			pam_deny.so/password    requisite   pam_cracklib.so retry=2 dcredit=-4 ucredit=-1 ocredit=-1 lcredit=0 minlen=10 reject_username/g' /etc/pam.d/common-password
328
+  echo 'enforce_good_passwords' >> $COMPLETION_FILE
329
+}
330
+
320
 function change_login_message {
331
 function change_login_message {
321
   if grep -Fxq "change_login_message" $COMPLETION_FILE; then
332
   if grep -Fxq "change_login_message" $COMPLETION_FILE; then
322
       return
333
       return
3414
 enable_backports
3425
 enable_backports
3415
 configure_dns
3426
 configure_dns
3416
 initial_setup
3427
 initial_setup
3428
+enforce_good_passwords
3417
 install_editor
3429
 install_editor
3418
 change_login_message
3430
 change_login_message
3419
 update_the_kernel
3431
 update_the_kernel