SHARE
TWEET

Untitled

a guest Jul 21st, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # read username
  4. read -p "Username: " username
  5.  
  6. # read password twice
  7. read -s -p "Password: " password
  8. echo
  9. read -s -p "Password (again): " password2
  10.  
  11. # check if passwords match and if not ask again
  12. while [ "$password" != "$password2" ];
  13. do
  14.     echo
  15.     echo "Please try again"
  16.     read -s -p "Password: " password
  17.     echo
  18.     read -s -p "Password (again): " password2
  19. done
  20.  
  21.  
  22. printf "$username:$(openssl passwd -crypt $password)\n" >> .htpasswd
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top