Ryan Zhao Ryan Zhao - 1 month ago 12
Linux Question

How to connect to a linux server only support xterm terminal

I want to ssh to a server with

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

enter image description here

Connect code:

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


How can I set the terminal type?

Answer

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:

ssh.invoke_shell(term='xterm')    
Comments