调用 pam_passwdqc.so 并报告密码强度、通过/失败的 C 程序
是否可以(以及在哪里可以找到接口文档)编写一个简单的 C 程序来使用 pam_passwdqc.so 来确定潜在密码是否足够强大以通过 passwd 下的集合?
Is it possible (and where would I find the interface documentation) to write a simple C program to use pam_passwdqc.so to determine if a potential password will be strong enough to pass muster under passwd?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您真正想要的是 libpasswdqc,它是 PAM 模块的独立版本。源/下载链接位于页面中间(注意,如果您只需要检查功能,您可能只需要库)。
文件 INTERNALS 将您指向标题,该标题简短且不言自明。文件
pwqcheck.c
几乎说明了您想要完成的任务。至少在我的 Ubuntu 工作站上,我找不到没有安装所有 PAM 位的软件包。如果依赖关系对您来说有问题,独立库足够小,可以放入几乎任何树中。
然后,您可以尝试链接到 DSO,接口可能是相同的。我的操作系统打包它的方式,很难说。该库使用我所见过的最宽松的 BSD 许可证版本,因此将其放在适当的位置不是问题:
I think what you actually want is libpasswdqc, which is the stand alone version of the PAM module. The source / download links are at the middle of the page(note, if you just want the checking functionality, you probably just want the library).
The file INTERNALS points you to the header, which is brief and self explanatory. The file
pwqcheck.c
illustrates pretty much what you want to accomplish.At least on my Ubuntu workstation, I could not find a package that didn't also install all of the PAM bits. The stand alone library is small enough to drop into almost any tree, if the dependency would be problematic for you.
Then again, you could try linking to the DSO, The interface might be the same. The way my OS packages it, it's kind of hard to tell. The library uses the most permissive version of the BSD license that I've ever seen, so dropping it in place is a non-issue:
Pam 正在使用 cracklib 进行密码检查,您也应该检查它。
Pam is using cracklib for password checking, you should check it also.