On Linux, I always go for something like:
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 24
On Linux you can use pwgen
On Linux you can use pwgen