我不明白为什么在我的 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
用您想要用于密码的最少字符数替换,保存并退出。