7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
10 # $Id: ssh,v 1.1 2006/04/06 21:51:59 mlhuang Exp $
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
17 # XXX Could make these configurable
25 MESSAGE=$"Generating SSH keys"
28 tmp=$(mktemp -d /tmp/ssh.XXXXXX)
30 # Generate root SSH key
31 if [ ! -f $PLC_ROOT_SSH_KEY_PUB -o ! -f $PLC_ROOT_SSH_KEY ] ; then
32 ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \
33 -b $KEY_LEN_ROOT -t $KEY_TYPE_ROOT -f $tmp/root
35 install -D -m 600 $tmp/root $PLC_ROOT_SSH_KEY
36 install -D -m 644 $tmp/root.pub $PLC_ROOT_SSH_KEY_PUB
39 # Generate debug SSH key
40 if [ ! -f $PLC_DEBUG_SSH_KEY_PUB -o ! -f $PLC_DEBUG_SSH_KEY ] ; then
41 ssh-keygen -N "" -C "$PLC_NAME Central <$PLC_MAIL_SUPPORT_ADDRESS>" \
42 -b $KEY_LEN_DEBUG -t $KEY_TYPE_DEBUG -f $tmp/debug
44 install -D -m 600 $tmp/debug $PLC_DEBUG_SSH_KEY
45 install -D -m 644 $tmp/debug.pub $PLC_DEBUG_SSH_KEY_PUB