#!/bin/bash # Prompt user for the name to use in the CSR echo -n "Enter the name to use in the CSR: " read csr_name # Create a new directory to store the CSR mkdir csr # Generate the CSR and save it in the new directory openssl req -new -newkey rsa:2048 -nodes -keyout csr/private_key.pem -out csr/csr.pem -subj "/CN=$csr_name"