【发布时间】:2022-06-24 01:01:06
【问题描述】:
我不明白为什么在连接到交换机时会创建 3 个连接,而我只能关闭 1 个,文档中对此没有任何说明。
account = Account(USER, PASSWORD)
conn = SSH2()
conn.connect(IP)
conn.login(account)
conn.execute('terminal length 0')
conn.execute('show users')
print(conn.response)
conn.send('exit')
conn.close()
打印:
show users
Line User Host(s) Idle Location
1 vty 0 user idle 00:00:05 10.3.0.251
2 vty 1 user idle 00:00:04 10.3.0.251
* 3 vty 2 user idle 00:00:00 10.3.0.251
【问题讨论】: