简体   繁体   中英

Python paramiko send 'CTRL-ALT-6-x' to exit console port

I'm using paramiko to ssh into an access server and connect to a console port. Everything is working fine except when it's time to exit the console port, I must do a 'CTRL-ALT-6 follow by x'.

I tried:

x.send("\036\px")

But it doesn't seem to work. How can I exit the console port correctly?

I found the solution with help...

x.send("\036")
time.sleep(1)
x.send("x")
time.sleep(1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM