如何使用php创建一个unix密码哈希值 [英] How do I create a unix password hash with php
问题描述
我试图用php脚本安全地创建系统用户,因此,我希望能够使用php脚本来散列密码,以便他们的密码在bash历史记录中无处显示。 p>
如何获取一个字符串,并对其进行哈希以便它是一个unix密码哈希?
$ UX_PW = some_function('my_password');
exec(useradd -p $ UX_PW newusername);
I'm trying to create system users with a php script securely, In that, I'd like to be able to hash the password with the php script, so that their password shows up nowhere in the bash history. How to I take a string, and hash it so it is a unix password hash?
It's 这篇关于如何使用php创建一个unix密码哈希值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
http://us.php.net/manual/en/function.crypt.php $UX_PW = some_function('my_password');
exec("useradd -p $UX_PW newusername");
crypt()
that implements the UNIX password hashing.
http://us.php.net/manual/en/function.crypt.php