diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 2c510bda9..248e9fa66 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2218,7 +2218,7 @@ sub CheckVersion Returns the os and version of the System you are running on Arguments: $type: which type of os infor you want. Supported values are: - all,os,version,release + all,os,version,release,platform Returns: 0 - ok Globals: @@ -2228,7 +2228,7 @@ sub CheckVersion Example: my $os=(xCAT::Utils->osver{ ...} Comments: - none + type=all does not return platform for backward compatibility reasons =cut @@ -2246,6 +2246,7 @@ sub osver my $ver = ''; my $rel = ''; my $line = ''; + my $platform = ''; my @lines; my $relfile; @@ -2286,6 +2287,9 @@ sub osver if ($line =~ /^\s*PRETTY_NAME=\"?(.*)/) { $prettyname = $1; } + if ($line =~ /^\s*PLATFORM_ID=\"?platform:(el\d+)/) { + $platform = $1; + } } } @@ -2446,6 +2450,8 @@ sub osver return ($ver); } elsif ($type and $type =~ /release/) { return ($rel); + } elsif ($type and $type =~ /platform/) { + return ($platform); } else { return ("$os" . "$ver"); } diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index d8e7ae1dd..e5a219e37 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -1005,16 +1005,19 @@ sub genSSHNodeHostKey } - xCAT::MsgUtils->message('I', "Generating SSH2 DSA Key..."); - $cmd = -"/usr/bin/ssh-keygen -t dsa -f /etc/xcat/hostkeys/ssh_host_dsa_key -C '' -N ''"; - $outref = xCAT::Utils->runcmd("$cmd", 0); - if ($::RUNCMD_RC != 0) - { - xCAT::MsgUtils->message('E', "Could not generate SSH2 DSA key."); - } - else{ - push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_dsa_key"; + # Skip DSA generation in EL10+ + if (xCAT::Utils->osver("platform") =~ /el(\d+)/ and $1 < 10) { + xCAT::MsgUtils->message('I', "Generating SSH2 DSA Key..."); + $cmd = + "/usr/bin/ssh-keygen -t dsa -f /etc/xcat/hostkeys/ssh_host_dsa_key -C '' -N ''"; + $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message('E', "Could not generate SSH2 DSA key."); + } + else{ + push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_dsa_key"; + } } # see if this system supports the ecdsa diff --git a/xCAT-server/share/xcat/scripts/setup-local-client.sh b/xCAT-server/share/xcat/scripts/setup-local-client.sh index 9407fee82..5f05f5925 100755 --- a/xCAT-server/share/xcat/scripts/setup-local-client.sh +++ b/xCAT-server/share/xcat/scripts/setup-local-client.sh @@ -70,9 +70,9 @@ mkdir -p $USERHOME/.xcat cd $USERHOME/.xcat openssl genrsa -out client-key.pem 2048 if [ $FORCE -eq 0 ]; then - openssl req -config $XCATCADIR/openssl.cnf -new -key client-key.pem -out client-req.pem -extensions usr_cert -subj "/CN=$CNA" + openssl req -config $XCATCADIR/openssl.cnf -new -key client-key.pem -out client-req.pem -subj "/CN=$CNA" else - openssl req -config $XCATCADIR/openssl.cnf -new -key client-key.pem -out client-req.pem -extensions usr_cert -subj "/CN=$CNA" -batch + openssl req -config $XCATCADIR/openssl.cnf -new -key client-key.pem -out client-req.pem -subj "/CN=$CNA" -batch fi cp client-req.pem $XCATDIR/ca/root.csr cd - >/dev/null