mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 11:42:05 +00:00
Merge pull request #915 from pdlun92/rsa
Removed keygen of SSH1 RSA Key
This commit is contained in:
commit
0685db16cb
@ -1606,7 +1606,7 @@ sub checkCredFiles
|
||||
$dir = "/etc/xcat/hostkeys";
|
||||
if (-d $dir)
|
||||
{
|
||||
my $file = "$dir/ssh_host_key.pub";
|
||||
my $file = "$dir/ssh_host_rsa_key.pub";
|
||||
if (-e $file)
|
||||
{
|
||||
my $file2 = "$dir/*.pub"; # all public keys
|
||||
|
@ -120,14 +120,12 @@ sub process_request {
|
||||
chmod(0700,$tempdir."$sshdir");
|
||||
copy("/root/.ssh/id_rsa.pub","$tempdir$sshdir/authorized_keys");
|
||||
chmod(0600,"$tempdir$sshdir/authorized_keys");
|
||||
if (not $invisibletouch and -r "/etc/xcat/hostkeys/ssh_host_key") {
|
||||
copy("/etc/xcat/hostkeys/ssh_host_key","$tempdir/etc/ssh_host_key");
|
||||
if (not $invisibletouch and -r "/etc/xcat/hostkeys/ssh_host_rsa_key") {
|
||||
copy("/etc/xcat/hostkeys/ssh_host_rsa_key","$tempdir/etc/ssh_host_rsa_key");
|
||||
copy("/etc/xcat/hostkeys/ssh_host_dsa_key","$tempdir/etc/ssh_host_dsa_key");
|
||||
chmod(0600,<$tempdir/etc/ssh_*>);
|
||||
}
|
||||
unless ($invisibletouch or -r "$tempdir/etc/ssh_host_key") {
|
||||
system("ssh-keygen -t rsa1 -f $tempdir/etc/ssh_host_key -C '' -N ''");
|
||||
unless ($invisibletouch or -r "$tempdir/etc/ssh_host_rsa_key") {
|
||||
system("ssh-keygen -t rsa -f $tempdir/etc/ssh_host_rsa_key -C '' -N ''");
|
||||
system("ssh-keygen -t dsa -f $tempdir/etc/ssh_host_dsa_key -C '' -N ''");
|
||||
}
|
||||
|
@ -949,15 +949,6 @@ sub genSSHNodeHostKey
|
||||
# generate new hostkeys
|
||||
#
|
||||
xCAT::MsgUtils->message('I', "Generating new node hostkeys...");
|
||||
xCAT::MsgUtils->message('I', "Generating SSH1 RSA Key...");
|
||||
my $cmd =
|
||||
"/usr/bin/ssh-keygen -t rsa1 -f /etc/xcat/hostkeys/ssh_host_key -C '' -N ''";
|
||||
my $outref = xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message('E', "Could not generate SSH1 RSA key.");
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->message('I', "Generating SSH2 RSA Key...");
|
||||
$cmd =
|
||||
"/usr/bin/ssh-keygen -t rsa -f /etc/xcat/hostkeys/ssh_host_rsa_key -C '' -N ''";
|
||||
|
@ -251,10 +251,8 @@ my @sysfilelist = (
|
||||
"/etc/nsswitch.conf",
|
||||
"/etc/ssh/ssh_host_rsa_key",
|
||||
"/etc/ssh/ssh_config",
|
||||
"/etc/ssh/ssh_host_key",
|
||||
"/etc/ssh/sshd_config",
|
||||
"/etc/ssh/ssh_host_dsa_key",
|
||||
"/etc/ssh/ssh_host_key.pub",
|
||||
"/root/.ssh/id_rsa",
|
||||
"/root/.ssh/id_rsa.pub",
|
||||
"/root/.ssh/authorized_keys",);
|
||||
|
@ -46,7 +46,7 @@ check:rc==0
|
||||
cmd:xcatconfig -s
|
||||
check:rc==0
|
||||
check:output=~(Generating new node hostkeys)
|
||||
cmd:diff /etc/xcat/hostkeys/ssh_host_key.pub /etc/xcat/hostkeysbak/ssh_host_key.pub
|
||||
cmd:diff /etc/xcat/hostkeys/ssh_host_rsa_key.pub /etc/xcat/hostkeysbak/ssh_host_rsa_key.pub
|
||||
check:rc!=0
|
||||
cmd:rm -rf /etc/xcat/hostkeysbak
|
||||
end
|
||||
@ -63,9 +63,7 @@ check:output=~Created xCAT certificate
|
||||
check:output=~Signature ok
|
||||
check:output=~OK
|
||||
check:output!~Fail
|
||||
cmd:diff /etc/xcat/hostkeys/ssh_host_key.pub /etc/xcat/hostkeysbak/ssh_host_key.pub
|
||||
check:rc!=0
|
||||
cmd:diff /etc/xcat/hostkeys/ssh_host_key.pub /etc/xcat/hostkeysbak/ssh_host_key.pub
|
||||
cmd:diff /etc/xcat/hostkeys/ssh_host_rsa_key.pub /etc/xcat/hostkeysbak/ssh_host_rsa_key.pub
|
||||
check:rc!=0
|
||||
cmd:rm -rf /etc/xcat/hostkeysbak
|
||||
cmd:rm -rf /root/.xcatbak
|
||||
|
Loading…
x
Reference in New Issue
Block a user