Changeset 2327 in ProjectBuilder for 0.14.6/pb/bin/pb
- Timestamp:
- Sep 24, 2017, 3:14:56 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
0.14.6/pb/bin/pb
r2315 r2327 4660 4660 my $ecdsa = 0; 4661 4661 my $dsa = 0; 4662 my $rsa = 0; 4662 4663 open(SCAN,"ssh-keyscan -p $nport -t ecdsa $target 2>/dev/null |") || pb_log(0,"Unable to check ECDSA support for $target"); 4663 4664 while(<SCAN>) { 4664 4665 $ecdsa = 1 if ($_ =~ /ecdsa-/); 4665 4666 pb_log(2,"Found ECDSA support on $target ($nport)\n"); 4667 } 4668 close(SCAN); 4669 4670 open(SCAN,"ssh-keyscan -p $nport -t rsa $target 2>/dev/null |") || pb_log(0,"Unable to check DSA support for $target"); 4671 while(<SCAN>) { 4672 $rsa = 1 if ($_ =~ /ssh-rsa/); 4673 pb_log(2,"Found RSA support on $target ($nport)\n"); 4666 4674 } 4667 4675 close(SCAN); … … 4683 4691 } 4684 4692 4685 #$keyfile = "$ENV{'HOME'}/.ssh/id_rsa" if (-s "$ENV{'HOME'}/.ssh/id_rsa"); 4686 # We still favoud DSA and fall back to ECDSA if not available 4687 if ($dsa != 0) { 4693 # Some ECDSA implementation are not working correctly e.g. RHEL7, Fedora 20/21 4694 if (!(-e "$ENV{'HOME'}/.ssh/pb_rsa") && ($create eq 1)) { 4695 pb_system("ssh-keygen -q -b 2048 -N '' -f $ENV{'HOME'}/.ssh/pb_rsa -t rsa","Generating RSA SSH keys for pb"); 4696 } 4697 4698 # We still favour RSA and fall back to ECDSA if not available 4699 $keyfile = "$ENV{'HOME'}/.ssh/id_rsa" if (-s "$ENV{'HOME'}/.ssh/id_rsa"); 4700 if ($rsa != 0) { 4688 4701 # And we favour a specific key over a generic one except if in delivery to ftp server 4689 $keyfile = "$ENV{'HOME'}/.ssh/id_ dsa" if ((-s "$ENV{'HOME'}/.ssh/id_dsa") && ($create eq 0));4690 $keyfile = "$ENV{'HOME'}/.ssh/pb_ dsa" if (-s "$ENV{'HOME'}/.ssh/pb_dsa");4702 $keyfile = "$ENV{'HOME'}/.ssh/id_rsa" if ((-s "$ENV{'HOME'}/.ssh/id_rsa") && ($create eq 0)); 4703 $keyfile = "$ENV{'HOME'}/.ssh/pb_rsa" if (-s "$ENV{'HOME'}/.ssh/pb_rsa"); 4691 4704 } else { 4692 # And we favour a specific key over a generic one except if in delivery to ftp server 4693 $keyfile = "$ENV{'HOME'}/.ssh/id_ecdsa" if ((-s "$ENV{'HOME'}/.ssh/id_ecdsa") && ($ecdsa != 0) && ($create eq 0)); 4694 $keyfile = "$ENV{'HOME'}/.ssh/pb_ecdsa" if ((-s "$ENV{'HOME'}/.ssh/pb_ecdsa") && ($ecdsa != 0)); 4705 if ($ecdsa != 0) { 4706 # And we favour a specific key over a generic one except if in delivery to ftp server 4707 $keyfile = "$ENV{'HOME'}/.ssh/id_ecdsa" if ((-s "$ENV{'HOME'}/.ssh/id_ecdsa") && ($ecdsa != 0) && ($create eq 0)); 4708 $keyfile = "$ENV{'HOME'}/.ssh/pb_ecdsa" if ((-s "$ENV{'HOME'}/.ssh/pb_ecdsa") && ($ecdsa != 0)); 4709 } elsif ($dsa != 0) { 4710 # And we favour a specific key over a generic one except if in delivery to ftp server 4711 $keyfile = "$ENV{'HOME'}/.ssh/id_dsa" if ((-s "$ENV{'HOME'}/.ssh/id_dsa") && ($dsa != 0) && ($create eq 0)); 4712 $keyfile = "$ENV{'HOME'}/.ssh/pb_dsa" if ((-s "$ENV{'HOME'}/.ssh/pb_dsa") && ($dsa != 0)); 4713 } 4695 4714 } 4696 4715 if (defined $keyfile) {
Note:
See TracChangeset
for help on using the changeset viewer.