path: root/scripts
diff options
authorPaul Eggleton <>2015-03-08 12:25:56 +0000
committerRichard Purdie <>2015-03-20 11:27:45 +0000
commitad57dab31f5d91327cadac196e8d620bc9df551e (patch)
treed029231ed449572f34095b9d2dd35e6b69baa78a /scripts
parentcb4b07838c267a09ebedba6c30ec25bda2cd11be (diff)
devtool: deploy-target: allow disabling host key checking
If you're testing with multiple images/devices that have the same IP address / hostname then it can be annoying to deal with host key mismatches all of the time. As a MITM attack is unlikely in the local test environment, provide a command line option to pass the appropriate options to scp/ssh to disable the host key checking. Note: if you wish to apply this permanently, the best way is to do it through your ssh configuration e.g. by adding the following to your ~/.ssh/config: Host UserKnownHostsFile=/dev/null StrictHostKeyChecking no (From OE-Core rev: 81dd1319112a99bc38b7a7ced0663918ac5b09a4) Signed-off-by: Paul Eggleton <> Signed-off-by: Ross Burton <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/lib/devtool/ b/scripts/lib/devtool/
index 896b618..d232d31 100644
--- a/scripts/lib/devtool/
+++ b/scripts/lib/devtool/
@@ -1,6 +1,6 @@
# Development tool - deploy/undeploy command plugin
-# Copyright (C) 2014 Intel Corporation
+# Copyright (C) 2014-2015 Intel Corporation
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -50,7 +50,10 @@ def deploy(args, config, basepath, workspace):
stdout, stderr = exec_build_env_command(config.init_path, basepath, 'bitbake -e %s' % args.recipename, shell=True)
recipe_outdir ='^D="(.*)"', stdout, re.MULTILINE).group(1)
- ret ='scp -qr %s/* %s:%s' % (recipe_outdir,, destdir), shell=True)
+ extraoptions = ''
+ if args.no_host_check:
+ extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ ret ='scp -qr %s %s/* %s:%s' % (extraoptions, recipe_outdir,, destdir), shell=True)
if ret != 0:
return ret
@@ -77,12 +80,16 @@ def undeploy(args, config, basepath, workspace):
logger.error('%s has not been deployed' % args.recipename)
return -1
- ret ="scp -q %s %s:/tmp" % (deploy_file,, shell=True)
+ extraoptions = ''
+ if args.no_host_check:
+ extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ ret ="scp -q %s %s %s:/tmp" % (extraoptions, deploy_file,, shell=True)
if ret != 0:
logger.error('Failed to copy %s to %s' % (deploy,
return -1
- ret ="ssh %s 'xargs -n1 rm -f </tmp/%s'" % (, os.path.basename(deploy_file)), shell=True)
+ ret ="ssh %s %s 'xargs -n1 rm -f </tmp/%s'" % (extraoptions,, os.path.basename(deploy_file)), shell=True)
if ret == 0:'Successfully undeployed %s' % args.recipename)
@@ -94,9 +101,11 @@ def register_commands(subparsers, context):
parser_deploy = subparsers.add_parser('deploy-target', help='Deploy recipe output files to live target machine')
parser_deploy.add_argument('recipename', help='Recipe to deploy')
parser_deploy.add_argument('target', help='Live target machine running an ssh server: user@hostname[:destdir]')
+ parser_deploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true')
parser_undeploy = subparsers.add_parser('undeploy-target', help='Undeploy recipe output files in live target machine')
parser_undeploy.add_argument('recipename', help='Recipe to undeploy')
parser_undeploy.add_argument('target', help='Live target machine running an ssh server: user@hostname')
+ parser_undeploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true')
OpenPOWER on IntegriCloud