]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: add HostKeyAlgorithms option to ssh and scp commands
authorSteve Sakoman <steve@sakoman.com>
Mon, 17 Oct 2022 17:31:45 +0000 (07:31 -1000)
committerSteve Sakoman <steve@sakoman.com>
Fri, 21 Oct 2022 16:28:52 +0000 (06:28 -1000)
With the newer version of ssh in Ubuntu 22.04 we are getting errors of this type:

Unable to negotiate with 192.168.7.2 port 22: no matching host key type found. Their offer: ssh-rsa

Add -o HostKeyAlgorithms=+ssh-rsa to command invocation as suggested at:

http://www.openssh.com/legacy.html

Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/selftest/cases/devtool.py
scripts/lib/devtool/deploy.py

index 87e71632ab7f85faf8c988e96dc553a8a85ad4e4..5febdde28e17a29ffc57b7dde635c34c43f92181 100644 (file)
@@ -1323,7 +1323,7 @@ class DevtoolExtractTests(DevtoolBase):
             # Now really test deploy-target
             result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip))
             # Run a test command to see if it was installed properly
-            sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+            sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa'
             result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
             # Check if it deployed all of the files with the right ownership/perms
             # First look on the host - need to do this under pseudo to get the correct ownership/perms
index e0f8e64b9c7546c30dd7f722bee3843283e3f4eb..b4f9fbfe459f09c8a64839a77c28ffb113eabd43 100644 (file)
@@ -201,9 +201,9 @@ def deploy(args, config, basepath, workspace):
                 print('  %s' % item)
             return 0
 
-        extraoptions = ''
+        extraoptions = '-o HostKeyAlgorithms=+ssh-rsa'
         if args.no_host_check:
-            extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+            extraoptions += ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
         if not args.show_status:
             extraoptions += ' -q'
 
@@ -274,9 +274,9 @@ def undeploy(args, config, basepath, workspace):
     elif not args.recipename and not args.all:
         raise argparse_oe.ArgumentUsageError('If you don\'t specify a recipe, you must specify -a/--all', 'undeploy-target')
 
-    extraoptions = ''
+    extraoptions = '-o HostKeyAlgorithms=+ssh-rsa'
     if args.no_host_check:
-        extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+        extraoptions += ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
     if not args.show_status:
         extraoptions += ' -q'