# -*- coding:utf-8 -*- #python 2.7 import optparse,sys,threading import pexpect PROMPT = ['#','>','/$'] def ssh(host,user,password): child = pexpect.spawn('ssh %s@%s' % (user,host)) ret = child.expect(['(?i)are you sure.*','(?i)password:',pexpect.TIM…