crypt.crypt。谢谢,这正是问题所在。谢谢,这正是问题所在。 python -c "import crypt,random,string; \ print crypt.crypt(raw_input('clear-text p

crypt.crypt。谢谢,这正是问题所在。谢谢,这正是问题所在。 python -c "import crypt,random,string; \ print crypt.crypt(raw_input('clear-text p,python,Python,crypt.crypt。谢谢,这正是问题所在。谢谢,这正是问题所在。 python -c "import crypt,random,string; \ print crypt.crypt(raw_input('clear-text password: '), '\$6\$' \ + ''.join([random.choice(string.ascii_letters + string.digits) \ for _ in ran


crypt.crypt
。谢谢,这正是问题所在。谢谢,这正是问题所在。
python -c "import crypt,random,string; \
           print crypt.crypt(raw_input('clear-text password: '), '\$6\$' \
           + ''.join([random.choice(string.ascii_letters + string.digits) \
           for _ in range(16)]))"
$6$oGLGsdsZpbbjUobu$lxAbyUYV17B5JEgIjAghvL8osZrFUccXkQ.RPW0AE0xbyKdhA.0WE3UWiwVI/0O0lXcaQ3jmIEFXjp5a6JajX1
#!/usr/bin/python

import crypt
import random
import string

print crypt.crypt(raw_input('clear-text password: '), '\$6\$'   \
 + ''.join([random.choice(string.ascii_letters + string.digits) \
 for _ in range(16)]))
./shadow.py
clear-text password: dir
\$c0UU5dohpjE
>>> crypt.crypt('any string', '\$6\$' + 'abc')
'\\$d5GL183q0Yo'
>>> crypt.crypt('any string', '$6$' + 'abc')
'$6$abc$h7OB.KW3LchliR... (truncated)'