First prepare the name and revision information of the CSR and KEY files.
# NAME=yournamehere
# VER=2023
# cd /etc/ssl
If you have an existing CSR that you want to copy data from you can extract the information from it using the following command:
# PVER=2022
# openssl req -text -in csr/$NAME.csr_$PVER | grep Subject:
Now generate the new CSR and corresponding KEY file:
# openssl req -nodes -newkey rsa:2048 -keyout private/$NAME.key_$VER -out
csr/$NAME.csr_$VER
Fill in the details you want and you have the CSR. Print the contents.
# cat csr/$NAME.csr_$VER