When you're working on different projects, each project will have it's own username, password, and set of access permissions. It's handy to have a quick and easy password generator that generates nice long secure passwords when you create each user for each project.
To generate passwords like this, we'll create an alias that executes a command that prints out six different passwords for us to choose from.
First, we need to install a package, named apg. apg is the software that generates the passwords. We'll use it and customize it's output in our Unix alias.
To Install Packages On Ubuntu:
# apt-get update && apt-get install apg
To Install Packages On Mac:
Based on:
https://stackoverflow.com/questions/50119657/how-to-install-apg-password-generator-on-osxOn the Mac Terminal, type:
$ brew tap jzaleski/homebrew-jzaleski
$ brew install apg
On Mac or Ubuntu
$ cat >> ~/.bashrc << EOF
# add alias to generate mysql user passwords
alias mypw='apg -a 1 -M ncl -n 6 -m 32'
EOF
make active
$ source ~/.bashrc
Then, whenever we want to generate a password, we just go to the Terminal and type:
$ mypw
WMxGD2e18ppbtOvNHMpCUDYRSCAGxqsK
cWg6k0aSMBH0A9WEYHUYCBKLuqBeRYUM
jm1Dp7rt54kS21tn219tnXEedLhNjKtu
Klqx1e6QGZX3CHZNdpR39aq2VbpxvrQL
HgVa3uS5t6Jxi0vrjtvSdxVNFNhU7J6t
8Z2MlE4OA7ntkFmNVSkEqzhMlGkKM6Dq