7

咨询大佬个密码验证的问题

 2 years ago
source link: https://www.v2ex.com/t/817894
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

咨询大佬个密码验证的问题

  d0m2o08 · 10 分钟前 · 23 次点击

Ansible 的 user 模块中,对如何生成用户密码给了集中方法,其中一种是这样实现的

/etc/ansible ⌚ 13:36:09
$ python -c "from passlib.hash import sha512_crypt; import getpass; print(sha512_crypt.using(rounds=5000).hash(getpass.getpass()))"
Password:
$6$ugLvJs2HQIVNoXW0$F8sbBsLT/dcU/HVFVlHqNNSpxZwwpt2R4tP7cE/JvYKjQnPX137YzNaPGo6t/EwX3Ick17Gm7E7N2qD.N.A3h/

/etc/ansible ⌚ 13:36:13
$ python -c "from passlib.hash import sha512_crypt; import getpass; print(sha512_crypt.using(rounds=5000).hash(getpass.getpass()))"
Password:
$6$EZ5ZGsr7dlFrHzS0$5vNcNAtkUw41P8NCuHpp.Um5DHoNoH8mSbmTjc0fTgH95Gq4zDFpcsnLvd4T26Zx0gSLRdBxlzkNdMHC.kLub.

/etc/ansible ⌚ 13:36:17
$ python -c "from passlib.hash import sha512_crypt; import getpass; print(sha512_crypt.using(rounds=5000).hash(getpass.getpass()))"
Password:
$6$zem4hGz27MgX4k8X$Mn6n08MCPtvCzbJTmjYVnBX/JpU7dEUKK.o0F60UA5rsbBLLLXZZb2bWRrBazpCHY.ugEPw0bgiwwvsvgfyTK/

/etc/ansible ⌚ 13:38:25
$

我每次输入的密码都是 1234 ,但是生成的值是不同的,那如何验证这些不同的值是同一个密码呢


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK