17 March 2021

Sometimes I need to create a random password so I created an alias, saved in ~/.bashrc, for my needs that use openssl:
alias random-psw='$(openssl rand -base64 8)'

Example in a containerized environment:

$ docker run -it ubuntu /bin/bash
root@2f07ea84c99b:/# apt update && apt install -y openssl
root@2f07ea84c99b:/# openssl rand -base64 8
0BUp74ivXSa6AA