Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
7fffb3f1
Commit
7fffb3f1
authored
Mar 15, 2012
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the host keys contruction from ssh into this separate script.
parent
bcfd18fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
22 deletions
+46
-22
install/phases/boss/hostkeys
install/phases/boss/hostkeys
+46
-0
install/phases/boss/ssh
install/phases/boss/ssh
+0
-22
No files found.
install/phases/boss/hostkeys
0 → 100755
View file @
7fffb3f1
#
# The template
#
use strict;
use libinstall;
use installvars;
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Replace if this script does an update for ip/domain.
return 0
if ($isupdate);
#
# Create a set of hostkeys for the images.
#
Phase "imagekeysdir", "Creating $IMAGEKEYS_DIR", sub {
DoneIfExists($IMAGEKEYS_DIR);
mkdir $IMAGEKEYS_DIR,0775 or
PhaseFail("Unable to create $IMAGEKEYS_DIR : $!");
ExecQuietFatal("$CHGRP tbadmin $IMAGEKEYS_DIR");
};
my %keytypes = (
"rsa1" => "ssh_host_key",
"rsa" => "ssh_host_rsa_key",
"dsa" => "ssh_host_dsa_key");
Phase "imagekeys", "Creating host keys for images", sub {
foreach my $type (keys(%keytypes)) {
my $name = $keytypes{$type};
Phase $type, "Creating $type host key", sub {
DoneIfExists("$IMAGEKEYS_DIR/$name");
ExecQuietFatal("$SSH_KEYGEN -t $type -N '' ".
" -f $IMAGEKEYS_DIR/$name");
};
}
};
return 0;
}
# Local Variables:
# mode:perl
# End:
install/phases/boss/ssh
View file @
7fffb3f1
...
...
@@ -19,28 +19,6 @@ sub Install($$$)
ExecQuietFatal("$SSH_KEYGEN -t rsa -P '' -f $ROOT_PRIVKEY");
};
#
# Create a set of hostkeys for the images.
#
Phase "imagekeysdir", "Creating $IMAGEKEYS_DIR", sub {
DoneIfExists($IMAGEKEYS_DIR);
mkdir $IMAGEKEYS_DIR,0775 or
PhaseFail("Unable to create $IMAGEKEYS_DIR : $!");
ExecQuietFatal("$CHGRP tbadmin $IMAGEKEYS_DIR");
};
my %keytypes = (
"rsa1" => "ssh_host_key",
"rsa" => "ssh_host_rsa_key",
"dsa" => "ssh_host_dsa_key");
Phase "imagekeys", "Creating host keys for images", sub {
foreach my $type (keys(%keytypes)) {
my $name = $keytypes{$type};
ExecQuietFatal("$SSH_KEYGEN -t $type -N '' ".
" -f $IMAGEKEYS_DIR/$name");
}
};
#
# Stick it into the DB.
# WARNING: This sitevar (node/ssh_pubkey) is referenced in tmcd.c
#
...
...
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