Last active
March 19, 2018 09:39
-
-
Save viktorbenei/cca967e09bf701aa9cb5 to your computer and use it in GitHub Desktop.
Bash script to generate secure passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# requires 'pwgen', can be installed with brew | |
# | |
# add this to your .bash_profile, .profile or .bashrc for quick terminal access | |
# input: the length of the password | |
# usage example: gensecpsw 16 | |
# example result: XjQ%uWQ.&7-T4@`( | |
# | |
gensecpsw() { | |
printf '%s' $(pwgen -B -c -s -n -y $1 1) |pbcopy; echo "Has been copied to clipboard" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment