Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.58 KB | None | 0 0
  1. #!/bin/bash                                                                                                                                
  2.                                                                                                                                            
  3. # This line will genereate a 32 char random pass using A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~ chars                                  
  4. #                                                                                                                                          
  5. #LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 32 ; echo                                          
  6.                                                                                                                                            
  7. # This line will genereate a 60 char random pass using A-Za-z0-9                                                                            
  8. #                                                                                                                                          
  9. #LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c 60 ; echo                                                                              
  10.                                                                                                                                            
  11. # This line will genereate a 16 char random pass using A-Za-z0-9!"#$%&'\''()*+,-./:; chars                                                  
  12. #                                                                                                                                          
  13. #LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;' </dev/urandom | head -c 16 ; echo                                                          
  14.                                                                                                                                            
  15. # The firts line will generate a random number between 16 an 32. This number will be the number os chars of the password                    
  16. # The second line generate a random pass using A-Za-z0-9!#$%&()*+,-./:;<=>?@[\] chars with the length of the random number created in the line above
  17. #                                                                                                                                          
  18. #digits=$(( RANDOM % (32 - 16 + 1 ) + 16 ))                                                                                                
  19. #                                                                                                                                          
  20. #LC_ALL=C tr -dc 'A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]' </dev/urandom | head -c $digits ; echo                                                  
  21.                                                                                                                                            
  22.                                                                                                                                            
  23. digits=$(( RANDOM % (32 - 16 + 1 ) + 16 ))                                                                                                  
  24.                                                                                                                                            
  25. LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c $digits ; echo                                      
  26. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement