X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fssh;h=21d4fea5c981b2de54fe4c388353bed10c896a4e;hb=27ae61d51ba27a22a2e9048b90fe158dd3fac592;hp=db4702398b5c8c3bb1e32b61521e570baa83a146;hpb=5efb05264954a0e2c2bde976a27abe7ca66685d4;p=myplc.git diff --git a/plc.d/ssh b/plc.d/ssh index db47023..21d4fea 100755 --- a/plc.d/ssh +++ b/plc.d/ssh @@ -1,16 +1,12 @@ #!/bin/bash -# $Id$ -# $URL$ # -# priority: 600 +# priority: 500 # # Generate SSH keys # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ -# # Source function library and configuration . /etc/plc.d/functions @@ -20,6 +16,8 @@ set -x # XXX Could make these configurable +KEY_TYPE_ROOT=rsa +KEY_LEN_ROOT=1024 KEY_TYPE_DEBUG=rsa KEY_LEN_DEBUG=2048 @@ -30,6 +28,15 @@ case "$1" in tmp=$(mktemp -d /tmp/ssh.XXXXXX) + # Generate root SSH key + if [ ! -f $PLC_ROOT_SSH_KEY_PUB -o ! -f $PLC_ROOT_SSH_KEY ] ; then + ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \ + -b $KEY_LEN_ROOT -t $KEY_TYPE_ROOT -f $tmp/root + check + install -D -m 600 $tmp/root $PLC_ROOT_SSH_KEY + install -D -m 644 $tmp/root.pub $PLC_ROOT_SSH_KEY_PUB + fi + # Generate debug SSH key if [ ! -f $PLC_DEBUG_SSH_KEY_PUB -o ! -f $PLC_DEBUG_SSH_KEY ] ; then ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \