如何连接到 linux 服务器只支持 xterm 终端

How to connect to a linux server only support xterm terminal

我想通过 paramiko 模块连接到服务器,但是当我这样做时,得到的服务器响应如下: Error:only 支持 xterm 终端

连接代码:

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=blip,username=bluser,password=blpasswd)
channel = ssh.invoke_shell()

如何设置终端类型? 我的晚上: OS:windows 7 IDE:pycharm python version:3.4

根据 this website,您需要将 TERM 环境变量设置为 'xterm'。

但是,根据 paramiko documentation,您可以告诉 invoke_shell 模拟这样的终端类型:

ssh.invoke_shell(term='xterm')