Commit 4116e6e2 authored by Leigh B Stoller's avatar Leigh B Stoller

Minor change to allow non admins to create a geni rack; need to

add an extra ssh pub key to elabman so that the user can log into
new boss, since when setting up a rack all existing accounts are
deleted. Store this key as ~/.ssh/elabinelab.pub.
parent e8ac64ef
......@@ -2002,6 +2002,9 @@ sub SetupBossNode($)
# Copy over creators ssl certificate for XMLRPC. See below.
mysystem("cp -fp ~${creator}/.ssl/emulab.pem $stuffdir");
# Copy extra ssh pub key for adding to elabman.
mysystem("cp -fp ~${creator}/.ssh/elabinelab.pub $stuffdir")
if (-e "/users/${creator}/.ssh/elabinelab.pub");
#
# Write the config variables out. genirack install phase needs it.
......@@ -2484,6 +2487,10 @@ sub SetupBossNode($)
mysystem("/etc/rc.sendmail start");
}
# Copy additional key into the install directory.
mysystem("cp -fp $stuffdir/elabinelab.pub $TBDIR/src/testbed/install")
if (-e "$stuffdir/elabinelab.pub");
#
# INNER OPS DEPENDENCY: boss-install eventually wants to NFS mount
# the filesystems on ops/fs, so at this point the ops/fs filesystems
......
......@@ -5,6 +5,8 @@ use strict;
use libinstall;
use installvars;
my $EXTRADSA_KEY = "$main::TOP_SRCDIR/install/elabinelab.pub";
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
......@@ -68,6 +70,13 @@ sub Install($$$)
ExecQuietFatal("$SUDO -u $PROTOUSER $WAP ".
" $ADDPUBKEY -f -u $PROTOUSER $PROTOUSER_KEY");
};
Phase "DSAKey2", "Adding Extra DSA key to $PROTOUSER account", sub {
PhaseSkip("No key found")
if (! -e $EXTRADSA_KEY);
ExecQuietFatal("$SUDO -u $PROTOUSER $WAP ".
" $ADDPUBKEY -R -f -u $PROTOUSER $EXTRADSA_KEY");
};
Phase "authkeys", "Generating authorized_keys for $PROTOUSER", sub {
ExecQuietFatal("$SUDO -u $PROTOUSER $WAP $ADDPUBKEY -w $PROTOUSER");
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment