Generate S3 Style Access and Secret keys for RadosGW

A quick little script to generate a random string in the right format for a S3 style Secret and Access Key

 

SYSTEM_ACCESS_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1)
SYSTEM_SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1)
echo "Access Key - $SYSTEM_ACCESS_KEY"
Access Key – Q2ZmWhN0NEyHDdIybp3N
echo "Secret Key - $SYSTEM_SECRET_KEY"
Secret Key – kfoK0hMGsCbZNrUXlPKwwpxlq65YvhprPraA87OS