Ryan Zhao Ryan Zhao - 1 year ago 136
Linux Question

How to connect to a linux server only support xterm terminal

I want to ssh to a server with

modules, but when I do this, the server return info like:

enter image description here

Connect code:

ssh = paramiko.SSHClient()
channel = ssh.invoke_shell()

How can I set the terminal type?

Answer Source

According to this website, you'd need to set the TERM environment variable to 'xterm'.

However, according to the paramiko documentation, you can tell invoke_shell to emulate a terminal type like so:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download