https://forum.huawei.com/enterprise/en/ssh-configuration-huawei-to-securecrt/thread/758245-861

我是找这这个配置配的,但是死活就是不成功,真的是害死人。。。

路由器上的报错是这样:

[SW1]
Jul 27 2022 00:47:13.90.1-08:00 SW1 SSH/7/ACCEPT:Received connection from 192.16
8.56.1.
Jul 27 2022 00:47:13.90.2-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Main_Conne
ct to SSH_Main_VersionMatch.
Jul 27 2022 00:47:13.90.3-08:00 SW1 SSH/7/VERSION_RECEIVE:Version information re
ceived on VTY 0, version string:SSH-2.0-SecureCRT_6.2.0 (build 195) SecureCRT
.
Jul 27 2022 00:47:13.90.4-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_KEXINIT packet.
Jul 27 2022 00:47:13.90.5-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Main_Versi
onMatch to SSH_Main_SSHProcess.
Jul 27 2022 00:47:13.90.6-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_KEXINIT pac
ket.
Jul 27 2022 00:47:13.90.7-08:00 SW1 SSH/7/KEX_DERECTION:Kex for direction is in.
Jul 27 2022 00:47:13.90.8-08:00 SW1 SSH/7/CHOOSE_ENCRYPT:Chose encryption algori
thm:aes128-cbc.
Jul 27 2022 00:47:13.90.9-08:00 SW1 SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-sh
a1.
Jul 27 2022 00:47:13.90.10-08:00 SW1 SSH/7/KEX_DERECTION:Kex for direction is ou
t.
Jul 27 2022 00:47:13.90.11-08:00 SW1 SSH/7/CHOOSE_ENCRYPT:Chose encryption algor
ithm:aes128-cbc.
Jul 27 2022 00:47:13.90.12-08:00 SW1 SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-s
ha1.
Jul 27 2022 00:47:13.90.13-08:00 SW1 SSH/7/CHOOSE_KEX:Choose Kex algorithm:diffi
e-hellman-group-exchange-sha1.
Jul 27 2022 00:47:13.90.14-08:00 SW1 SSH/7/CHOOSE_PK:Choose PK algorithm:ssh-dss
.
Jul 27 2022 00:47:13.90.15-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_
Init to SSH_Sub1_KEX_GEX_Group.
Jul 27 2022 00:47:13.90.16-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_KEX_DH_GEX
_REQUEST packet.
Jul 27 2022 00:47:13.90.17-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_KEX_DH_GEX_GRO
UP packet.
Jul 27 2022 00:47:13.90.18-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_
GEX_Group to SSH_Sub1_KEX_GEX_Reply.
Jul 27 2022 00:47:13.160.1-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_KEX_DH_GEX
_INIT packet.
Jul 27 2022 00:47:13.160.2-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_KEX_DH_GEX_REP
LY packet.
Jul 27 2022 00:47:13.160.3-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_NEWKEYS packet
.
Jul 27 2022 00:47:13.160.4-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_
GEX_Reply to SSH_Sub1_KEX_NewKey.
Jul 27 2022 00:47:13.240.1-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_NEWKEYS pa
cket.
Jul 27 2022 00:47:13.240.2-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_
NewKey to SSH_Sub1_Authentication.
Jul 27 2022 00:47:13.240.3-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_SERVICE_RE
QUEST packet.
Jul 27 2022 00:47:13.240.4-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_SERVICE_ACCEPT
 packet.
Jul 27 2022 00:47:13.240.5-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub2_Serv
ice_Acc to SSH_Sub2_Auth_Init.
Jul 27 2022 00:47:20.670.1-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub2_Auth
_Init to SSH_Sub2_Auth_Password.
Jul 27 2022 00:47:20.670.2-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub3_Auth
_Password_Auth to SSH_Sub3_Auth_Password_Auth_Wait.
Jul 27 2022 00:47:20.670.3-08:00 SW1 SSH/7/MSG_RECEIVE_VTY:AAA write event messa
ge received on VTY 0.
Jul 27 2022 00:47:20.670.4-08:00 SW1 SSH/7/AUTH_AAA:The AAA authentication of us
er user01 succeeded.
Jul 27 2022 00:47:20.670.5-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub3_Auth
_Password_Auth_WAIT to SSH_Sub3_Auth_PK.
Jul 27 2022 00:47:20.670.6-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_Auth
entication to SSH_Sub1_Channel.
Jul 27 2022 00:47:20.670.7-08:00 SW1 SSH/7/READ_PKT:Expected packet type:SSH2_MS
G_CHANNEL_OPEN, failed to read data from packet!
Jul 27 2022 00:47:20.700.1-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_CHANNEL_OP
EN packet.
Jul 27 2022 00:47:20.700.2-08:00 SW1 SSH/7/SEND_PKT:Sent SSH2_MSG_CHANNEL_OPEN_C
ONFIRMATION packet.
Jul 27 2022 00:47:20.700.3-08:00 SW1 SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_Chan
nel to SSH_Sub1_Session.
Jul 27 2022 00:47:20.700.4-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_CHANNEL_RE
QUEST packet.
Jul 27 2022 00:47:20.700.5-08:00 SW1 SSH/7/REQUEST_PTY:SSH_CMSG_REQUEST_PTY mess
age received on VTY 0( Terminal environment variable value=vt100, Terminal heigh
t=24 row, Terminal width=80 column, Terminal width=0 pixels) .
Jul 27 2022 00:47:20.720.1-08:00 SW1 SSH/7/RECV_PKT:Received SSH2_MSG_CHANNEL_RE
QUEST packet.
Jul 27 2022 00:47:20.720.2-08:00 SW1 SSH/7/MSG_RECEIVE_VTY:SSH_CMSG_EXEC_SHELL m
essage received on VTY 0.
Jul 27 2022 00:47:20.720.3-08:00 SW1 SSH/7/STELNET_SERVICE:The STELNET service o
f the SSH user user01 is disabled. Use the command' ssh user {user-name} service
-type stelnet|all' to enable it.
Jul 27 2022 00:47:20.720.4-08:00 SW1 SSH/7/DISSCONNECT:The connection is closed 
by SSH server, current FSM is SSH_Main_Disconnect! 

我真的是无力吐槽了,因为配置是照这个地方写的

我从重新修改了一下,该死的必须要加上ssh user 这几条命令

R1:
sys
 sys SW1
  int vlan1
   ip add 192.168.56.2 24
 user-interface vty 0 4
   authen aaa
   protocol inbound ssh
 quit 
 stelnet server enable
 ssh user user01 authentication-type all
 ssh user user01 service-type stelnet
 aaa
  local-user user01 password cipher 123456 priv level 15
  local-user user01 service-type ssh
quit

这样就可以了