#!/usr/bin/env python
#coding=utf-8
'''
import time
import pexpect
time1 = time.strftime('%y.%m.%d-%H:%M:%S')
List = ['10.109.101.99','10.107.101.99']
filename = open('/tmp/test1.txt', 'w')
con = pexpect.spawn('/usr/bin/ssh cisco@192.168.1.254')
con.expect()
'''
import time
import getpass
import pexpect
storage = open('/tmp/test.txt', 'w')
con = pexpect.spawn('/usr/bin/ssh yong@114.80.xx.xx -p 5022')
password = getpass.getpass('Password:')
con.expect('Password:')
con.send(password + '\n')
con.expect('.*Select group: ')
#coding=utf-8
'''
import time
import pexpect
time1 = time.strftime('%y.%m.%d-%H:%M:%S')
List = ['10.109.101.99','10.107.101.99']
filename = open('/tmp/test1.txt', 'w')
con = pexpect.spawn('/usr/bin/ssh cisco@192.168.1.254')
con.expect()
'''
import time
import getpass
import pexpect
storage = open('/tmp/test.txt', 'w')
con = pexpect.spawn('/usr/bin/ssh yong@114.80.xx.xx -p 5022')
password = getpass.getpass('Password:')
con.expect('Password:')
con.send(password + '\n')
con.expect('.*Select group: ')