Computer Tips - Linux: How do I make a self-signed certificate with no password?

Date: 2007dec11 OS: Linux Language: bash Q. Linux: How do I make a self-signed certificate with no password? A. This script does the trick:
#!/bin/sh usage() { echo 'Usage: makecert <hostname>' >&2 exit 1 } if [ $# -ne 1 ]; then usage fi HOST=$1 openssl genrsa 1024 > $HOST.key chmod 400 $HOST.key openssl req -new -x509 -nodes -sha1 -days 3650 -key $HOST.key > $HOST.cert cat $HOST.cert $HOST.key > $HOST.pem chmod 400 $HOST.pem
You might want to save the certificate in /etc/pki/tls/certs