Created
March 3, 2017 11:10
-
-
Save iamweird/9e7ccb885ace398ce6f034fdd72612f8 to your computer and use it in GitHub Desktop.
Simple PHP script to generate /etc/shadow style $6$ (SHA-512) password hashes
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
#!/usr/bin/env php | |
<?php | |
if (count($argv) < 3) { | |
echo <<<USAGE | |
Usage: genshadow.php salt password | |
USAGE; | |
exit(0); | |
} | |
$salt = $argv[1]; | |
$password = $argv[2]; | |
echo crypt($password, "\$6\$$salt\$"), "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment