Created
November 5, 2013 07:48
-
-
Save tkuchiki/7315343 to your computer and use it in GitHub Desktop.
/etc/shadow のパスワードを hash を生成するシェルスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# $1 : password | |
set +o posix # require process substitution | |
HASH='$6$'`sha1sum <(date) | awk '{print $1}'` | |
set -o posix | |
python -c "import crypt; print crypt.crypt(\"${1}\", \"${HASH}\")"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment