Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created November 5, 2013 07:48
Show Gist options
  • Save tkuchiki/7315343 to your computer and use it in GitHub Desktop.
Save tkuchiki/7315343 to your computer and use it in GitHub Desktop.
/etc/shadow のパスワードを hash を生成するシェルスクリプト
#!/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