<small id='sasOm'></small><noframes id='sasOm'>

    <i id='sasOm'><tr id='sasOm'><dt id='sasOm'><q id='sasOm'><span id='sasOm'><b id='sasOm'><form id='sasOm'><ins id='sasOm'></ins><ul id='sasOm'></ul><sub id='sasOm'></sub></form><legend id='sasOm'></legend><bdo id='sasOm'><pre id='sasOm'><center id='sasOm'></center></pre></bdo></b><th id='sasOm'></th></span></q></dt></tr></i><div id='sasOm'><tfoot id='sasOm'></tfoot><dl id='sasOm'><fieldset id='sasOm'></fieldset></dl></div>
      • <bdo id='sasOm'></bdo><ul id='sasOm'></ul>
      <tfoot id='sasOm'></tfoot>
    1. <legend id='sasOm'><style id='sasOm'><dir id='sasOm'><q id='sasOm'></q></dir></style></legend>

      1. paramiko.exec_command() 未执行并返回“在 CLI 中找到的额外参数"

        paramiko.exec_command() not executing and returns quot;Extra params found in CLIquot;(paramiko.exec_command() 未执行并返回“在 CLI 中找到的额外参数)

        • <bdo id='1fU9C'></bdo><ul id='1fU9C'></ul>
            <tbody id='1fU9C'></tbody>

            <legend id='1fU9C'><style id='1fU9C'><dir id='1fU9C'><q id='1fU9C'></q></dir></style></legend>
          1. <small id='1fU9C'></small><noframes id='1fU9C'>

              <tfoot id='1fU9C'></tfoot>

                <i id='1fU9C'><tr id='1fU9C'><dt id='1fU9C'><q id='1fU9C'><span id='1fU9C'><b id='1fU9C'><form id='1fU9C'><ins id='1fU9C'></ins><ul id='1fU9C'></ul><sub id='1fU9C'></sub></form><legend id='1fU9C'></legend><bdo id='1fU9C'><pre id='1fU9C'><center id='1fU9C'></center></pre></bdo></b><th id='1fU9C'></th></span></q></dt></tr></i><div id='1fU9C'><tfoot id='1fU9C'></tfoot><dl id='1fU9C'><fieldset id='1fU9C'></fieldset></dl></div>

                  本文介绍了paramiko.exec_command() 未执行并返回“在 CLI 中找到的额外参数"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Paramiko 对服务器进行 ssh 并执行命令.但是 paramiko.exec_command() 返回错误.为什么会这样?

                  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?

                  这是我的 Python 脚本:

                  This is my Python script:

                  import paramiko
                  
                  ssh = paramiko.SSHClient()
                  ssh.load_system_host_keys()
                  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
                  ssh.connect('10.126.141.132', username='usrm', password='passwd')
                  
                  stdin, stdout, stderr = ssh.exec_command("show chassis")
                  
                  print(stdout.readlines())
                  
                  ssh.close()
                  

                  执行时它会返回以下消息:

                  When executed it returns with this message:

                  ['在 CLI 中发现额外参数,不支持,退出 CLI 会话: ']

                  ['Extra params found in CLI, this is not supported, exiting the CLI session: ']

                  我在 Windows 上使用 Python 3.5.2 :: Anaconda 4.1.1(64 位)和 Paramiko.

                  I am using Python 3.5.2 :: Anaconda 4.1.1 (64-bit) with Paramiko on Windows.

                  我已经手动尝试了这些命令并且它正在工作.

                  I have tried the commands manually and it is working.

                  推荐答案

                  根据您的最新评论:

                  我安装了 Cygwin 终端并使用命令对服务器进行 SSH...它出现了 Extra params 错误.我执行的命令:ssh usrm@10.126.141.132 "show chassis",输出:No entry for terminal type "dumb";使用哑终端设置.在 CLI 中发现额外参数,不支持,退出 CLI 会话:

                  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:

                  好像usrm账号在SSH服务器上的login shell不允许以非交互方式运行命令.要解决问题,您必须像这样使用 invoke_shell():

                  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
                  ')
                  s = chan.recv(4096)
                  print s
                  

                  这篇关于paramiko.exec_command() 未执行并返回“在 CLI 中找到的额外参数"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)
                  <i id='GEvTv'><tr id='GEvTv'><dt id='GEvTv'><q id='GEvTv'><span id='GEvTv'><b id='GEvTv'><form id='GEvTv'><ins id='GEvTv'></ins><ul id='GEvTv'></ul><sub id='GEvTv'></sub></form><legend id='GEvTv'></legend><bdo id='GEvTv'><pre id='GEvTv'><center id='GEvTv'></center></pre></bdo></b><th id='GEvTv'></th></span></q></dt></tr></i><div id='GEvTv'><tfoot id='GEvTv'></tfoot><dl id='GEvTv'><fieldset id='GEvTv'></fieldset></dl></div>
                    <tbody id='GEvTv'></tbody>

                    <bdo id='GEvTv'></bdo><ul id='GEvTv'></ul>

                    1. <small id='GEvTv'></small><noframes id='GEvTv'>

                          • <legend id='GEvTv'><style id='GEvTv'><dir id='GEvTv'><q id='GEvTv'></q></dir></style></legend>
                            <tfoot id='GEvTv'></tfoot>