2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

xcatconfig: add ed25519 host key support

This commit is contained in:
Kurt H Maier 2022-03-25 10:24:44 -07:00
parent 0ed366820c
commit 8256685f86

View File

@ -1011,6 +1011,21 @@ sub genSSHNodeHostKey
else{
push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_ecdsa_key";
}
# see if this system supports the ed25519
xCAT::Utils->runcmd('rm -rf /tmp/ed25519_key >/dev/null 2>&1 ; /usr/bin/ssh-keygen -t ed25519 -f /tmp/ed25519_key -P "" &>/dev/null', 0);
if ($::RUNCMD_RC == 0) {
xCAT::MsgUtils->message('I', "Generating SSH2 ed25519 Key...");
$cmd =
"/usr/bin/ssh-keygen -t ed25519 -f /etc/xcat/hostkeys/ssh_host_ed25519_key -C '' -N ''";
$outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 ed25519 key.");
}
else{
push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_ed25519_key";
}
}
if(@sshkeylist){