The following command lines avoid specifying parameters as much as possible hoping that your version of OpenSSL will make the best choices for the current time and that it will allow this recipe to stay up-to-date as long as possible.
Generate a 4096 bits long key using the RSA algorithm.
> openssl genrsa -out key.pem 4096