9 # Mark Huang <mlhuang@cs.princeton.edu>
10 # Copyright (C) 2006 The Trustees of Princeton University
15 # Source function library and configuration
16 . /etc/plc.d/functions
17 . /etc/planetlab/plc_config
22 # XXX Could make these configurable
30 MESSAGE=$"Generating SSH keys"
33 tmp=$(mktemp -d /tmp/ssh.XXXXXX)
35 # Generate root SSH key
36 if [ ! -f $PLC_ROOT_SSH_KEY_PUB -o ! -f $PLC_ROOT_SSH_KEY ] ; then
37 ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \
38 -b $KEY_LEN_ROOT -t $KEY_TYPE_ROOT -f $tmp/root
40 install -D -m 600 $tmp/root $PLC_ROOT_SSH_KEY
41 install -D -m 644 $tmp/root.pub $PLC_ROOT_SSH_KEY_PUB
44 # Generate debug SSH key
45 if [ ! -f $PLC_DEBUG_SSH_KEY_PUB -o ! -f $PLC_DEBUG_SSH_KEY ] ; then
46 ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \
47 -b $KEY_LEN_DEBUG -t $KEY_TYPE_DEBUG -f $tmp/debug
49 install -D -m 600 $tmp/debug $PLC_DEBUG_SSH_KEY
50 install -D -m 644 $tmp/debug.pub $PLC_DEBUG_SSH_KEY_PUB