Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

generate ssh host keys on boot

0 views
Skip to first unread message

bl8n8r

unread,
Nov 18, 2009, 1:28:00 PM11/18/09
to
..add to /etc/init.d/ssh init script
-------------------------------------------------------------------------------------------
# stolen from redhat init script (but works on debian)
KEYGEN=/usr/bin/ssh-keygen
RSA_KEY=/etc/ssh/ssh_host_rsa_key
DSA_KEY=/etc/ssh/ssh_host_dsa_key

# create host RSA key if not there
if [ ! -f /etc/ssh/ssh_host_rsa_key ] || [ ! -f /etc/ssh/
ssh_host_rsa_key.pub ]; then
echo "Generating SSH2 RSA host key:
"
$KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >/dev/
null
fi

# create host dsa key if not there
if [ ! -f /etc/ssh/ssh_host_dsa_key ] || [ ! -f /etc/ssh/
ssh_host_dsa_key.pub ]; then
echo "Generating SSH2 DSA host key:
"
$KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >/dev/
null
fi

0 new messages