Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- username="username"
- passwd="password"
- try:
- child=pexpect.spawn("ssh -C2qTnNf -D XXXX xxxx@qualifier1.qualifier2.net")
- i=child.expect('password:')
- print(i)
- if i==0:
- print(passwd)
- time.sleep (0.5)
- child.sendline(passwd)
- child.expect('$')
- time.sleep(2)
- print(child)
- print(child.isalive())
- print('####')
- child.close(force=True)
- #child.terminate(force=True)
- time.sleep(5)
- print(child.isalive())
- print(child)
- except Exception as e:
- print(str(e))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement