Month: August 2015

OS X Password Generator in BASH

How do I generate random passwords on the command line using the terminal we have 2 options installing pwgen or add Bash function to create random password

Install pwgen (use Homebrew)

$ brew install pwgen

Add the following to your ~/.bash_profile

genpasswd() {
local l=$1
[ “$l” == “” ] && l=16
LC_ALL=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs Read More