Skip to content

Instantly share code, notes, and snippets.

@sebastianwagner
Created July 11, 2013 08:19
Show Gist options
  • Save sebastianwagner/5973542 to your computer and use it in GitHub Desktop.
Save sebastianwagner/5973542 to your computer and use it in GitHub Desktop.
Create password hashes for magento using salt from stdin or terminal requires pwgen
#!/bin/sh
# magento_adminpassword.sh
#
# reads an password from stdin or terminal and creates hash with salt for magento
# USAGE
# echo hai | ./adminpassword.sh
# or
# ./adminpassword.sh
# depends on pwgen for creation of salt
read -p 'password: ' PASS; SALT=$(pwgen -s 2 1); echo $(echo -n "$SALT$PASS"| md5sum | cut -d \ -f 1):"$SALT"
# check with
# echo -n i8hai| md5sum
# where i8 is the salt given and hai the password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment