Commit b61dbd0a authored by Leigh Stoller's avatar Leigh Stoller

Remove extraneous ports from sshd_config, these are the ones we

add for VMs, but we were never deleting them and after a while
sshd refuses to start.
parent 500d6719
......@@ -43,6 +43,7 @@ my $NTPDRIFT1 = "/etc/ntp/drift";
my $NTPDRIFT2 = "/var/lib/ntp/drift";
my $SFSUSERS = "/etc/sfs/sfs_users";
my $SFSHOSTKEY = "/etc/sfs/sfs_host_key";
my $SSHDCONFIG = "/etc/ssh/sshd_config";
my $VARACCTDIR = "/var/account";
my $VARACCTSDIR = "/var/log/sa";
my $IFTAB = "/etc/iftab";
......@@ -416,6 +417,14 @@ foreach my $file (@SOCKETS) {
}
}
print "Removing extra Ports from $SSHDCONFIG\n";
if (-e $SSHDCONFIG) {
# Remove high numbered ports.
system("sed -i.bak -e '/^Port [0-9]\{3,\}/d' $SSHDCONFIG");
warn("*** Could not remove Port lines\n")
if ($?);
}
# Leave this print statement here; create_image depends on it.
print "prepare ran successfully!\n";
exit 0;
......
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