paramiko.exec_command() not executing and returns “Extra params found in CLI”

前端 未结 1 2009
清酒与你
清酒与你 2020-12-22 01:55

I am trying to ssh a server using Paramiko and execute a command. But the paramiko.exec_command() returns with an error.Why is this happening?

This is my Python scri

相关标签:
1条回答
  • 2020-12-22 02:25

    Based on your latest comment:

    I installed a Cygwin Terminal and SSH'd the server with the command...it came up with the Extra params error. Command I executed: ssh usrm@10.126.141.132 "show chassis", Output: No entry for terminal type "dumb"; using dumb terminal settings. Extra params found in CLI, this is not supported, exiting the CLI session:

    it sounds like the usrm account's login shell on the SSH server is not allowed to run commands in the non-interactive way. To solve the problem you have to use invoke_shell() like this:

    chan = ssh.invoke_shell()
    chan.sendall('show chassis\r')
    s = chan.recv(4096)
    print s
    
    0 讨论(0)
提交回复
热议问题