Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # read username
- read -p "Username: " username
- # read password twice
- read -s -p "Password: " password
- echo
- read -s -p "Password (again): " password2
- # check if passwords match and if not ask again
- while [ "$password" != "$password2" ];
- do
- echo
- echo "Please try again"
- read -s -p "Password: " password
- echo
- read -s -p "Password (again): " password2
- done
- printf "$username:$(openssl passwd -crypt $password)\n" >> .htpasswd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement