#!/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 # Prompt user for the file name to use for the CSR and private key echo -n "Enter the file name to use for the CSR and private key (without file extension): " read file_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/$file_name.pem -out csr/$file_name.pem -subj "/CN=$csr_name"