Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
c895a3cd
Commit
c895a3cd
authored
Mar 02, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install phase for shellinabox support.
parent
5cf5823a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
install/phases/boss/shellinabox
install/phases/boss/shellinabox
+87
-0
No files found.
install/phases/boss/shellinabox
0 → 100644
View file @
c895a3cd
#
# Install shellinabox. This does not install shellinabox on ops,
# currently need to do that by hand. Get the code from Utah at
#
# git clone http://git-public.flux.utah.edu/git/shellinabox.git
#
# Then (on ops) cd into the top directory:
#
# ops> ./configure
# ops> make
# ops> sudo make install
#
use strict;
use libinstall;
use installvars;
my $SHAREDKEY = "$PREFIX/etc/sshauth.key";
my $LOGFILE = "$PREFIX/log/shellinabox.log";
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Replace if this script does an update for ip/domain.
return 0
if ($isupdate);
Phase "shellinabox", "Adding ShellInABox Support", sub {
Phase "syslog", "Setting up syslog on ops", sub {
if (ExecQuiet("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" grep -q -s shellinabox $SYSLOG_CONF")) {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"\\\!shellinabox\" >> $SYSLOG_CONF'");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"*.*\t\t $LOGFILE\" >> $SYSLOG_CONF'");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"$LOGFILE\t\t640 7 1000 * Z\" ".
" >> $NEWSYSLOG_CONF'");
}
};
#
# Need a secret shared key for signing.
#
Phase "createkey", "Creating shared key", sub {
DoneIfExists($SHAREDKEY);
ExecQuietFatal("/bin/dd if=/dev/urandom count=128 bs=1 | ".
" /sbin/md5 -q > $SHAREDKEY");
};
Phase "copykey", "Copying shared key to users", sub {
ExecQuietFatal("$SCP -p $SHAREDKEY ${USERNODE}:${SHAREDKEY}");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'chmod 600 $SHAREDKEY'");
};
Phase "httpdconf", "Copying new httpd.conf to ops", sub {
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache all");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" '/bin/cp -fp ${INSTALL_APACHE_CONFIG}/httpd.conf ".
" ${INSTALL_APACHE_CONFIG}/httpd.conf.$$'");
ExecQuietFatal("$SCP -p $TOP_OBJDIR/apache/httpd.conf-ops ".
" ${USERNODE}:${INSTALL_APACHE_CONFIG}/httpd.conf");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" $APACHE_START_COMMAND restart");
};
Phase "logfile", "Creating logfile on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'touch $LOGFILE; chmod 640 $LOGFILE'");
};
Phase "json", "Installing json port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/converters/p5-JSON; make install'");
};
Phase "hmac", "Installing hmac digest port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/secret/p5-Digest-HMAC; make install'");
};
Phase "sha1", "Installing sha1 digest port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/secret/p5-digest-SHA1; make install'");
};
};
return 0;
}
# Local Variables:
# mode:perl
# End:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment