Skip to content

Instantly share code, notes, and snippets.

@fischerscode
Last active September 10, 2021 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fischerscode/f46b3c213731ee1cf5c798a9955da6fb to your computer and use it in GitHub Desktop.
Save fischerscode/f46b3c213731ee1cf5c798a9955da6fb to your computer and use it in GitHub Desktop.
Generate a random password using urandom. eg. `./generate_password.sh 32`
#!/bin/bash
LC_ALL=C tr -dc 'A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c $1 ; echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment