Unrecognized character in the output stream while connecting network device using SSH.

huangapple go评论78阅读模式
英文:

Unrecognized character in the output stream while connecting network device using SSH

问题

在使用SSH连接网络设备时,输出流中出现了一些无法识别的字符,但是当我通过putty连接时,它显示了一个空白区域,而不是这些无法识别的字符。有人可以帮助我吗?我正在使用“j2ssh-maverick1.5.2”库来通过SSH连接设备。

输出流输出:

  HP J9eA 2522-24G Switch

Software revision YA.15.13.0005

Copyright (C) 1991-2014 Hewlett-Packard Development Company, L.P.

                 RESTRICTED RIGHTS LEGEND
 Confidential computer software.  Valid license from HP required for possession,
 use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer
 Software, Computer Software Documentation, and Technical Data for Commercial
 Items are licensed to the U.S. Government under vendor's standard commercial
 license.
                   HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P. 
                   20555 State Highway 249, Houston, TX 77070

[1;15r[1;1H[44;1HPress any key to continue[15;1H[?25h[300;27H[?6l[1;300r[?7l[2J[1;1H[1920;1920H[6n[1;1HYour previous successful login (as manager) was on 1990-01-26 15:59:52     
 from 10.30.222.231
[1;44r[300;1H[44;1H[2K[300;1H[?25h[300;1H[44;1HHP-2522-24G# [300;1H[44;14H[300;1H[?25h[300;14H

Putty输出

Copyright (C) 1991-2014 Hewlett-Packard Development Company, L.P.

                   RESTRICTED RIGHTS LEGEND
 Confidential computer software.  Valid license from HP required for possession,
 use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer
 Software, Computer Software Documentation, and Technical Data for Commercial
 Items are licensed to the U.S. Government under vendor's standard commercial
 license.
                   HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
                   20555 State Highway 249, Houston, TX 77070

Press any key to continue
Your previous successful login (as manager) was on 1990-01-26 15:14:36
 from 10.30.222.231

HP-2522-24G#
英文:

I got some unrecognised character in the output stream while connecting network device using SSH, But when I connect through putty, it shows a blank area instead of those unrecognised characters? Can someone help me with this? I am using "j2ssh-maverick1.5.2" library to connect the device through SSH.

Output stream output:
<pre>
HP J9eA 2522-24G Switch

Software revision YA.15.13.0005

Copyright (C) 1991-2014 Hewlett-Packard Development Company, L.P.

             RESTRICTED RIGHTS LEGEND

Confidential computer software. Valid license from HP required for possession,
use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer
Software, Computer Software Documentation, and Technical Data for Commercial
Items are licensed to the U.S. Government under vendor's standard commercial
license.
HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
20555 State Highway 249, Houston, TX 77070

[1;15r[1;1H[44;1HPress any key to continue[15;1H[?25h[300;27H[?6l[1;300r[?7l[2J[1;1H[1920;1920H[6n[1;1HYour previous successful login (as manager) was on 1990-01-26 15:59:52
from 10.30.222.231
[1;44r[300;1H[44;1H[2K[300;1H[?25h[300;1H[44;1HHP-2522-24G# [300;1H[44;14H[300;1H[?25h[300;14H
</pre>

Putty output
<pre>
Copyright (C) 1991-2014 Hewlett-Packard Development Company, L.P.

               RESTRICTED RIGHTS LEGEND

Confidential computer software. Valid license from HP required for possession,
use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer
Software, Computer Software Documentation, and Technical Data for Commercial
Items are licensed to the U.S. Government under vendor's standard commercial
license.
HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
20555 State Highway 249, Houston, TX 77070

Press any key to continue
Your previous successful login (as manager) was on 1990-01-26 15:14:36
from 10.30.222.231

HP-2522-24G#

</pre>

答案1

得分: 0

这些是来自终端的字符控制序列。

当您创建SshSession时,您可能使用requestPseudoTerminal API调用请求了一个伪终端。

如果您不需要将会话的输出连接到终端仿真器,则最好的方法是使用一个简单的终端。

session.requestPseudoTerminal("dumb", 80, 25, 0, 0);

如果这不起作用,您将不得不完全省略伪终端请求。

英文:

These are character control sequences from a terminal.

When you created your SshSession, you likely requested a pseudo-terminal using the requestPseudoTerminal API call.

If you don't need to hook the output of the session up to a terminal emulator, then the best course of action is to use a dumb terminal.

session.requestPseudoTerminal(&quot;dumb&quot;, 80, 25, 0, 0);

If that does not work you will have to omit the pseudo-terminal request altogether.

huangapple
  • 本文由 发表于 2020年8月4日 20:01:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/63246457.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定