密碼強度

密碼強度

我不明白為什麼在我的 Ubuntu 安裝上有如此小的密碼字元限制。我認為大約有13個字元。有沒有辦法修改 Ubuntu 以便我可以擁有更長的密碼?

答案1

Ubuntu 中的密碼複雜度由 PAM 控制。

man pam_unix

   pam_unix - Module for traditional password authentication

   This is the standard Unix authentication module. It uses standard calls
   from the system's libraries to retrieve and set account information as
   well as authentication. Usually this is obtained from the /etc/passwd
   and the /etc/shadow file as well if shadow is enabled.

開啟控制密碼複雜性的檔案:

sudo gedit /etc/pam.d/common-password

有一行:

password [success=1 default=ignore] pam_unix.so obscure sha512

它定義了密碼複雜性的基本規則。您可以透過將其變更為以下方式來新增最小長度覆蓋:

password [success=1 default=ignore] pam_unix.so obscure sha512 minlen=20

替換20為您要用於保存密碼並退出的最小字元數。

了解有關 PAM 的更多資訊。

相關內容