EOF error with both exec_command and invoke_shell method in paramiko
问题 I am trying to execute a command on linux server from my windows machine using python paramiko , I used both of the methods 1.exec_command 2.invoke_shell Both of them giving EOF error. import paramiko import time def ConnectSSH1(host, port, username, password): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host, int(port), username, password) chan = ssh.invoke_shell() # Throws EOF error here #stdin, stdout, stderr = ssh.exec_command("ls")