gpt4 book ai didi

python-2.7 - Paramiko ssh输出停止在--more--

转载 作者:行者123 更新时间:2023-12-02 14:37:31 25 4
gpt4 key购买 nike

输出在--more--停止打印,不知道如何获得输出的结尾

 >>> import paramiko
>>> ssh = paramiko.SSHClient()
>>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
>>> conn=ssh.connect("ipaddress",username="user", password="pass")
>>> channel = ssh.invoke_shell()
>>> channel.send("en\n")
3
>>> channel.send("password\n")
9
>>> channel.send("show security local-user-list\n")
30
>>> results = ''
>>> channel.send("\n")
1
>>> results += channel.recv(5000)
>>> print results

bluecoat>en
Password:
bluecoat#show security local-user-list
Default List: local_user_database
Append users loaded from file to default list: false
local_user_database
Lockout parameters:
Max failed attempts: 60
Lockout duration: 3600
Reset interval: 7200
Users:
Groups:

admin_local
Lockout parameters:
Max failed attempts: 60
Lockout duration: 3600
Reset interval: 7200
Users:
<username>
Hashed Password:
Enabled: true
Groups:

<username>
Hashed Password:
Enabled: true
**--More--**

如您在上方看到的,输出在--more--停止打印,任何想法如何使输出打印到最后。

最佳答案

在paramiko connect方法中增加终端的高度可以解决此问题

关于python-2.7 - Paramiko ssh输出停止在--more--,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24828263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com