Fix bug of known host
authorPeng Li <seudut@gmail.com>
Fri, 22 Jun 2018 09:26:06 +0000 (17:26 +0800)
committerPeng Li <seudut@gmail.com>
Fri, 22 Jun 2018 09:26:06 +0000 (17:26 +0800)
suanzi-support

index 678853d..183f6de 100755 (executable)
@@ -38,7 +38,7 @@ def getAvailablePort(host, ports):
 def exec_ssh(port):
     if port == None:
         raise Exception('Port not avaliable')
-    command = 'sshpass -p' + PASSWORD + ' ssh -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -fCR ' + str(port) +':localhost:22 ' + USER + '@' + SSH_SERVER + ' sleep ' + str(ALIVE_TIME)
+    command = 'sshpass -p' + PASSWORD + ' ssh -o "StrictHostKeyChecking=no"  -o "UserKnownHostsFile /dev/null" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -fCR ' + str(port) +':localhost:22 ' + USER + '@' + SSH_SERVER + ' sleep ' + str(ALIVE_TIME)
     print command
     return call(shlex.split(command), shell=False)