defect 4231
This commit is contained in:
parent
b42741e5a1
commit
5ad5eb1b1e
@ -201,11 +201,31 @@ sub setupSSH
|
||||
$msg = "aixremoteshell: Could not get ssh_host_rsa_key file.\n";
|
||||
`logger -t xcat -p local4.err $msg`;
|
||||
}
|
||||
if ( $nodetype eq "service") {
|
||||
# is there is a ecdsa host key on the node, then get the one from the MN/SN
|
||||
my $filename = "/etc/ssh/ssh_host_ecdsa_key";
|
||||
if (-e $filename) {
|
||||
my $response=&getresponse("ssh_ecdsa_hostkey");
|
||||
if (defined ($response) ) {
|
||||
my $fd;
|
||||
&runcmd("mkdir -p /etc/ssh");
|
||||
open($fd, '>',$filename);
|
||||
print $fd $response;
|
||||
close($fd);
|
||||
|
||||
# set the permissions
|
||||
my $cmd = "chmod 600 $filename > /dev/null 2>&1";
|
||||
&runcmd($cmd);
|
||||
}
|
||||
else {
|
||||
$msg = "aixremoteshell: Could not get ssh_host_ecdsa_key file.\n";
|
||||
`logger -t xcat -p local4.err $msg`;
|
||||
}
|
||||
}
|
||||
if ( $nodetype eq "service") {
|
||||
&runcmd("mkdir -p /etc/xcat/hostkeys; cp /etc/ssh/ssh* /etc/xcat/hostkeys/. > /dev/null 2>&1");
|
||||
}
|
||||
# Decide whether to enable ssh between the nodes
|
||||
if ($enablesshbetweennodes eq "YES") {
|
||||
# Decide whether to enable passwordless ssh between the nodes
|
||||
if ($enablesshbetweennodes eq "YES") {
|
||||
my $response=&getresponse("ssh_root_key");
|
||||
if (defined ($response) ) {
|
||||
my $fd;
|
||||
@ -216,7 +236,6 @@ sub setupSSH
|
||||
close($fd);
|
||||
|
||||
# set the permissions
|
||||
#TODO - what perms are needed???
|
||||
my $cmd = "chmod 600 $filename > /dev/null 2>&1";
|
||||
&runcmd($cmd);
|
||||
|
||||
@ -227,8 +246,8 @@ sub setupSSH
|
||||
else {
|
||||
$msg = "aixremoteshell: Could not get id_rsa file.\n";
|
||||
`logger -t xcat -p local4.err $msg`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user