# [OpenSSH] Trouble to connect to a Switch but... [Solved]

## y351

Hi,

I met some trouble to connect to a Huawei switch with OpenSSH client.

There is no problem to connect to this switch with Remmina or Putty.

```

Portage 3.0.7 (python 3.6.11-final-0, default/linux/amd64/17.1/hardened/selinux, gcc-9.3.0, glibc-2.31-r6, 5.8.9-gentoo x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-5.8.9-gentoo-x86_64-Intel-R-_Core-TM-_i7-5557U_CPU_@_3.10GHz-with-gentoo-2.7

KiB Mem:    16268684 total,   3299336 free

KiB Swap:    8388604 total,   8387308 free

Timestamp of repository gentoo: Fri, 18 Sep 2020 00:45:01 +0000

Head commit of repository gentoo: cf5b00d2045d7f2a81b183fa90a77522a1c9ee45

sh bash 5.0_p18

ld GNU ld (Gentoo 2.33.1 p2) 2.33.1

ccache version 3.7.11 [enabled]

app-shells/bash:          5.0_p18::gentoo

dev-java/java-config:     2.3.1::gentoo

dev-lang/perl:            5.30.3::gentoo

dev-lang/python:          2.7.18-r1::gentoo, 3.6.11-r2::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo

dev-util/ccache:          3.7.11::gentoo

dev-util/cmake:           3.16.5::gentoo

dev-util/pkgconfig:       0.29.2::gentoo

sys-apps/baselayout:      2.7::gentoo

sys-apps/openrc:          0.42.1::gentoo

sys-apps/sandbox:         2.18::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo

sys-devel/automake:       1.16.1-r1::gentoo

sys-devel/binutils:       2.33.1-r1::gentoo

sys-devel/gcc:            9.3.0-r1::gentoo

sys-devel/gcc-config:     2.3.1::gentoo

sys-devel/libtool:        2.4.6-r6::gentoo

sys-devel/make:           4.2.1-r4::gentoo

sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)

sys-libs/glibc:           2.31-r6::gentoo

Repositories:

gentoo

    location: /usr/portage

    sync-type: rsync

    sync-uri: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-extra-opts:

    sync-rsync-verify-metamanifest: yes

    sync-rsync-verify-max-age: 24

    sync-rsync-verify-jobs: 1

local

    location: /usr/local/portage

    masters: gentoo

    priority: 10

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="@FREE"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -fforce-addr -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=native -O2 -fforce-addr -pipe"

DISTDIR="/usr/portage/distfiles"

EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.0 --keep-going=y --with-bdeps=y --complete-graph"

ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install

preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="http://local/gentoo/"

LANG="fr_FR.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j5"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git

"

PORTAGE_TMPDIR="/var/tmp"

USE="X acl amd64 branding bzip2 chroot crypt cryptsetup elogind ffmpeg gnutls hardened iconv icu ipv6 jpeg libglvnd libtirpc logrotate lzma mmx modplug multilib ncurses nls nptl opengl openmp pam pax_kernel pcre perl pic pie png python rea

dline seccomp secure_delete selinux snmp split-usr sse sse2 ssl ssp symlink tcpd unicode wavpack webrsync-gpg xattr xml xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu

10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon auth

n_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_

config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="load memory syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3

 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rt

cm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS=

"presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_7 python3_6" QEMU_SOFTMMU_TARG

ETS="arm x86_64 sparc" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq ste

al rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================

                        Package Settings

=================================================================

net-misc/openssh-8.1_p1-r4::gentoo was built with the following:

USE="X X509 audit hpn kerberos pam (pie) (selinux) ssl -bindist -debug -ldns -libedit -libressl -livecd -sctp -static -test -xmss" ABI_X86="(64)"

FEATURES="network-sandbox ipc-sandbox buildpkg preserve-libs binpkg-docompress news sesandbox ebuild-locks selinux distlocks qa-unresolved-soname-deps protect-owned strict userpriv unknown-features-warn config-protect-if-modified multilib-

strict sandbox parallel-install usersync fixlafiles binpkg-dostrip sfperms parallel-fetch unmerge-logs usersandbox xattr assume-digests binpkg-logs userfetch merge-sync ccache unmerge-orphans"

```

Here are the logs from the ssh server when it works with Putty client :

```

Sep 18 2020 11:15:39.980.1+02:00 DST xxxxxxxx SSH/7/ACCEPT:Received connection from x.x.x.x.

Sep 18 2020 11:15:39.980.2+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Main_Connect to SSH_Main_VersionMatch.

Sep 18 2020 11:15:39.980.3+02:00 DST xxxxxxxx SSH/7/VERSION_RECEIVE:Version information received on VTY 2, version string:SSH-2.0-PuTTY_Release_0.74.

Sep 18 2020 11:15:39.980.4+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent ssh2 msg kexinit packet.

Sep 18 2020 11:15:39.980.5+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Main_VersionMatch to SSH_Main_SSHProcess.

Sep 18 2020 11:15:40.10.1+02:00 DST xxxxxxxx SSH/7/NO_INFO:ssh packet read poll2, (ulBufLen(1016) < ulNeed(1160) + ulMaclen(0))

Sep 18 2020 11:15:40.10.2+02:00 DST xxxxxxxx SSH/7/READ_PKT:Expected packet type:ssh2 msg kex init, failed to read data from packet!

Sep 18 2020 11:15:40.10.3+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kex init packet.

Sep 18 2020 11:15:40.10.4+02:00 DST xxxxxxxx SSH/7/KEX_DERECTION:Kex for direction is in.

Sep 18 2020 11:15:40.10.5+02:00 DST xxxxxxxx SSH/7/CHOOSE_ENCRYPT:Chose encryption algorithm:aes256-ctr.

Sep 18 2020 11:15:40.10.6+02:00 DST xxxxxxxx SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-sha2-256.

Sep 18 2020 11:15:40.10.7+02:00 DST xxxxxxxx SSH/7/KEX_DERECTION:Kex for direction is out.

Sep 18 2020 11:15:40.10.8+02:00 DST xxxxxxxx SSH/7/CHOOSE_ENCRYPT:Chose encryption algorithm:aes256-ctr.

Sep 18 2020 11:15:40.10.9+02:00 DST xxxxxxxx SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-sha2-256.

Sep 18 2020 11:15:40.10.10+02:00 DST xxxxxxxx SSH/7/CHOOSE_KEX:Choose Kex algorithm:diffie-hellman-group-exchange-sha1.

Sep 18 2020 11:15:40.10.11+02:00 DST xxxxxxxx SSH/7/CHOOSE_PK:Choose PK algorithm:ecdsa-sha2-nistp521.

Sep 18 2020 11:15:40.10.12+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_Init to SSH_Sub1_KEX_GEX_Group.

Sep 18 2020 11:15:40.10.13+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received 34 packet.

Sep 18 2020 11:15:40.10.14+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent 31 packet.

Sep 18 2020 11:15:40.10.15+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_GEX_Group to SSH_Sub1_KEX_GEX_INIT.

Sep 18 2020 11:15:40.70.1+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kex dh gex init packet.

Sep 18 2020 11:15:40.70.2+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_GEX_INIT to SSH_Sub1_KEX_GEX_Reply.

Sep 18 2020 11:15:40.90.1+02:00 DST xxxxxxxx SSH/7/NO_INFO:Begin to compute the dh shared key.

Sep 18 2020 11:15:40.600.1+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg ecdh reply packet.

Sep 18 2020 11:15:40.600.2+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kex dh gex init packet.

Sep 18 2020 11:15:40.600.3+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent SSH2_MSG_KEX_DH_GEX_REPLY packet.

Sep 18 2020 11:15:40.600.4+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent SSH2_MSG_NEWKEYS packet.

Sep 18 2020 11:15:40.600.5+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_GEX_Reply to SSH_Sub1_KEX_NewKey.

Sep 18 2020 11:15:40.670.1+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg newkeys packet.

Sep 18 2020 11:15:40.670.2+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_NewKey to SSH_Sub1_Authentication.

Sep 18 2020 11:15:40.670.3+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg service request packet.

Sep 18 2020 11:15:40.670.4+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent ssh2 msg service accept packet.

Sep 18 2020 11:15:40.670.5+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 11:15:40.670.6+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 11:15:40.750.1+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, result: 1

Sep 18 2020 11:15:40.750.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Failure, method: publickey,keyboard-interactive,password, partial: 0

Sep 18 2020 11:15:40.750.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 3

Sep 18 2020 11:15:40.750.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 11:15:40.770.1+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Fail to check the type.

Sep 18 2020 11:15:40.770.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Fail to check the type.

Sep 18 2020 11:15:40.770.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Fail to check the type.

Sep 18 2020 11:15:40.770.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, result: 4

Sep 18 2020 11:15:40.770.5+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Failure, method: keyboard-interactive,password, partial: 0

Sep 18 2020 11:15:40.770.6+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 3

Sep 18 2020 11:15:40.770.7+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 11:15:40.790.1+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Add vtydrv and seqid, seqid: 215

Sep 18 2020 11:15:40.790.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Send a request, result: 0

Sep 18 2020 11:15:40.790.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 20

Sep 18 2020 11:15:40.790.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 10, result: 2

Sep 18 2020 11:15:40.850.1+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In VTYD, receive an aaa event, ulMsg[0]=11, ulMsg[1]=178, ulMsg[3]=36

Sep 18 2020 11:15:40.850.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Receive an event, type: 11

Sep 18 2020 11:15:40.850.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Process the ack message, sub3 fsm: 10, result: 7

Sep 18 2020 11:15:40.850.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing the event, result: 7

Sep 18 2020 11:15:40.850.5+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 10, ulRet: 21

Sep 18 2020 11:15:40.850.6+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 10, result: 21

Sep 18 2020 11:15:40.850.7+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 11:15:40.850.8+02:00 DST xxxxxxxx SSH/7/NO_INFO:ssh packet read poll2, ssh incomplete msg-2

Sep 18 2020 11:15:40.850.9+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 11, ulRet: 2

Sep 18 2020 11:15:40.850.10+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 11:15:40.850.11+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 11:15:42.520.1+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Send data, ulMsgType: 178, ulRet: 0

Sep 18 2020 11:15:42.520.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 11, ulRet: 22

Sep 18 2020 11:15:42.520.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 11, result: 22

Sep 18 2020 11:15:42.520.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 12, result: 2

Sep 18 2020 11:15:42.650.1+02:00 DST xxxxxxxx SSH/7/MSG_RECEIVE_VTY:The aaa write an event, event:0 message received on VTY 2.

Sep 18 2020 11:15:42.650.2+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In VTYD, receive an aaa event, ulMsg[0]=0, ulMsg[1]=0, ulMsg[3]=36

Sep 18 2020 11:15:42.650.3+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Receive an event, type: 0

Sep 18 2020 11:15:42.650.4+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing the event, result: 0

Sep 18 2020 11:15:42.650.5+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, result: 0

Sep 18 2020 11:15:42.650.6+02:00 DST xxxxxxxx SSH/7/AUTH_AAA:The AAA authentication of user xxxxxxxx succeeded.

Sep 18 2020 11:15:42.650.7+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 12, ulRet: 0

Sep 18 2020 11:15:42.650.8+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 12, result: 0

Sep 18 2020 11:15:42.650.9+02:00 DST xxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 12, result: 0

Sep 18 2020 11:15:42.650.10+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_Authentication to SSH_Sub1_Channel.

Sep 18 2020 11:15:42.650.11+02:00 DST xxxxxxxx SSH/7/NO_INFO:ssh packet read poll2, ssh incomplete msg-2

Sep 18 2020 11:15:42.650.12+02:00 DST xxxxxxxx SSH/7/READ_PKT:Expected packet type:ssh2 msg channel open, failed to read data from packet!

Sep 18 2020 11:15:42.770.1+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg channel open packet.

Sep 18 2020 11:15:42.770.2+02:00 DST xxxxxxxx SSH/7/SEND_PKT:Sent ssh2 msg channel open confirmation packet.

Sep 18 2020 11:15:42.770.3+02:00 DST xxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_Channel to SSH_Sub1_Session.

Sep 18 2020 11:15:42.810.1+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg channel request packet.

Sep 18 2020 11:15:42.810.2+02:00 DST xxxxxxxx SSH/7/CHANNEL_TYPE:The channel request type is pty-req.

Sep 18 2020 11:15:42.810.3+02:00 DST xxxxxxxx SSH/7/REQUEST_PTY:VRP_SSH_CMSG_REQUEST_PTY message received on VTY 2( Terminal environment variable value=xterm, Terminal height=24 row, Terminal width=80 column, Terminal width=0 pixels) .

Sep 18 2020 11:15:42.810.4+02:00 DST xxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg channel request packet.

Sep 18 2020 11:15:42.810.5+02:00 DST xxxxxxxx SSH/7/CHANNEL_TYPE:The channel request type is shell.

Sep 18 2020 11:15:42.810.6+02:00 DST xxxxxxxx SSH/7/MSG_RECEIVE_VTY:VRP_SSH_CMSG_EXEC_SHELL message received on VTY 2.

```

When it does not work i.e. when i use OpenSSH client, the logs from the server :

NB : I removed all options from ~/.ssh/config

```

Sep 18 2020 10:39:00.530.1+02:00 DST xxxxxxxxxx SSH/7/ACCEPT:Received connection from x.x.x.x.

Sep 18 2020 10:39:00.530.2+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Main_Connect to SSH_Main_VersionMatch.

Sep 18 2020 10:39:00.530.3+02:00 DST xxxxxxxxxx SSH/7/VERSION_RECEIVE:Version information received on VTY 1, version string:SSH-2.0-OpenSSH_8.1p1-PKIXSSH-12.3-hpn14v20 PKIX[12.3].

Sep 18 2020 10:39:00.530.4+02:00 DST xxxxxxxxxx SSH/7/SEND_PKT:Sent ssh2 msg kexinit packet.

Sep 18 2020 10:39:00.530.5+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Main_VersionMatch to SSH_Main_SSHProcess.

Sep 18 2020 10:39:00.530.6+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kex init packet.

Sep 18 2020 10:39:00.530.7+02:00 DST xxxxxxxxxx SSH/7/KEX_DERECTION:Kex for direction is in.

Sep 18 2020 10:39:00.530.8+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_ENCRYPT:Chose encryption algorithm:aes128-ctr.

Sep 18 2020 10:39:00.530.9+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-sha2-256.

Sep 18 2020 10:39:00.530.10+02:00 DST xxxxxxxxxx SSH/7/KEX_DERECTION:Kex for direction is out.

Sep 18 2020 10:39:00.530.11+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_ENCRYPT:Chose encryption algorithm:aes128-ctr.

Sep 18 2020 10:39:00.530.12+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_MAC:Chose MAC algorithm:hmac-sha2-256.

Sep 18 2020 10:39:00.530.13+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_KEX:Choose Kex algorithm:diffie-hellman-group14-sha1.

Sep 18 2020 10:39:00.530.14+02:00 DST xxxxxxxxxx SSH/7/CHOOSE_PK:Choose PK algorithm:ecdsa-sha2-nistp521.

Sep 18 2020 10:39:00.530.15+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_Init to SSH_Sub1_KEX_GRP_Init.

Sep 18 2020 10:39:00.730.1+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kexdh init packet.

Sep 18 2020 10:39:00.730.2+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_GRP_Init to SSH_Sub1_KEX_GRP_Reply.

Sep 18 2020 10:39:00.730.3+02:00 DST xxxxxxxxxx SSH/7/NO_INFO:Begin to compute the dh shared key.

Sep 18 2020 10:39:01.290.1+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg group reply packet.

Sep 18 2020 10:39:01.290.2+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg kex dh group init packet.

Sep 18 2020 10:39:01.290.3+02:00 DST xxxxxxxxxx SSH/7/SEND_PKT:Sent SSH2_MSG_KEXDH_REPLY packet.

Sep 18 2020 10:39:01.290.4+02:00 DST xxxxxxxxxx SSH/7/SEND_PKT:Sent SSH2_MSG_NEWKEYS packet.

Sep 18 2020 10:39:01.290.5+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_GRP_Reply to SSH_Sub1_KEX_NewKey.

Sep 18 2020 10:39:01.320.1+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg newkeys packet.

Sep 18 2020 10:39:01.320.2+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_KEX_NewKey to SSH_Sub1_Authentication.

Sep 18 2020 10:39:01.350.1+02:00 DST xxxxxxxxxx SSH/7/RECV_PKT:Received ssh2 msg service request packet.

Sep 18 2020 10:39:01.350.2+02:00 DST xxxxxxxxxx SSH/7/SEND_PKT:Sent ssh2 msg service accept packet.

Sep 18 2020 10:39:01.350.3+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 10:39:01.350.4+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 10:39:01.350.5+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, result: 1

Sep 18 2020 10:39:01.350.6+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Failure, method: publickey,keyboard-interactive,password, partial: 0

Sep 18 2020 10:39:01.350.7+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 3

Sep 18 2020 10:39:01.350.8+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 1, sub3 fsm: 1, result: 2

Sep 18 2020 10:39:01.350.9+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Add vtydrv and seqid, seqid: 206

Sep 18 2020 10:39:01.350.10+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Send a request, result: 0

Sep 18 2020 10:39:01.350.11+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 1, sub3 fsm: 1, result: 20

Sep 18 2020 10:39:01.350.12+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 10, result: 2

Sep 18 2020 10:39:01.380.1+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In VTYD, receive an aaa event, ulMsg[0]=11, ulMsg[1]=178, ulMsg[3]=35

Sep 18 2020 10:39:01.380.2+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Receive an event, type: 11

Sep 18 2020 10:39:01.380.3+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Process the ack message, sub3 fsm: 10, result: 7

Sep 18 2020 10:39:01.380.4+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing the event, result: 7

Sep 18 2020 10:39:01.380.5+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 10, ulRet: 21

Sep 18 2020 10:39:01.380.6+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 10, result: 21

Sep 18 2020 10:39:01.380.7+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 10:39:01.380.8+02:00 DST xxxxxxxxxx SSH/7/NO_INFO:ssh packet read poll2, ssh incomplete msg-2

Sep 18 2020 10:39:01.380.9+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 11, ulRet: 2

Sep 18 2020 10:39:01.380.10+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 10:39:01.380.11+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 11, result: 2

Sep 18 2020 10:39:03.420.1+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Send data, ulMsgType: 178, ulRet: 0

Sep 18 2020 10:39:03.420.2+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 11, ulRet: 22

Sep 18 2020 10:39:03.420.3+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 11, result: 22

Sep 18 2020 10:39:03.420.4+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 12, result: 2

Sep 18 2020 10:39:03.530.1+02:00 DST xxxxxxxxxx SSH/7/MSG_RECEIVE_VTY:The aaa write an event, event:0 message received on VTY 1.

Sep 18 2020 10:39:03.530.1+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In VTYD, receive an aaa event, ulMsg[0]=0, ulMsg[1]=0, ulMsg[3]=35

Sep 18 2020 10:39:03.530.2+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Receive an event, type: 0

Sep 18 2020 10:39:03.530.3+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing the event, result: 0

Sep 18 2020 10:39:03.530.4+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, result: 0

Sep 18 2020 10:39:03.530.5+02:00 DST xxxxxxxxxx SSH/7/AUTH_AAA:The AAA authentication of user xxxxxxxxxx succeeded.

Sep 18 2020 10:39:03.530.6+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. In sub2 keyboard-interactive fsm, process the sub3, fsm: 12, ulRet: 0

Sep 18 2020 10:39:03.530.7+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish processing Au once, sub2 fsm: 5, sub3 fsm: 12, result: 0

Sep 18 2020 10:39:03.530.8+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Finish Au once, change the fsm, sub2 fsm: 5, sub3 fsm: 12, result: 0

Sep 18 2020 10:39:03.530.9+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Sub1_Authentication to SSH_Sub1_Channel.

Sep 18 2020 10:39:03.530.10+02:00 DST xxxxxxxxxx SSH/7/NO_INFO:ssh packet read poll2, ssh incomplete msg-2

Sep 18 2020 10:39:03.530.11+02:00 DST xxxxxxxxxx SSH/7/READ_PKT:Expected packet type:ssh2 msg channel open, failed to read data from packet!

Sep 18 2020 10:39:03.540.1+02:00 DST xxxxxxxxxx SSH/7/ERROR_PKT:Received unexpected packet type:expect packet type was ssh2 msg channel open, but received type was 20.

Sep 18 2020 10:39:03.540.2+02:00 DST xxxxxxxxxx SSH/7/DISCONNECT:The connection is closed by SSH server, current FSM is SSH_Main_SSHProcess.

Sep 18 2020 10:39:03.540.3+02:00 DST xxxxxxxxxx SSH/7/FSM_MOVE:FSM moved from SSH_Main_SSHProcess to SSH_Main_Disconnect.

Sep 18 2020 10:39:03.540.4+02:00 DST xxxxxxxxxx SSH/7/AUTH_EVENT:SSH authentication event occurs. Send cut message, result: 0

```

Logs from the client OpenSSH, when it does not work :

```

OpenSSH_8.1p1-PKIXSSH-12.3-hpn14v20, OpenSSL 1.1.1g  21 Apr 2020

debug1: Can't process default engine config file: No such file or directory

debug1: Reading configuration data /home/xxxxx/.ssh/config

debug1: /home/xxxxx/.ssh/config line 14: Applying options for xxxxxxxxxxxxxx

debug1: /home/xxxxx/.ssh/config line 357: Applying options for *

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: ssh_set_validator: ignore responder url

debug1: Connecting to x.x.x.x [x.x.x.x] port 22.

debug1: Connection established.

debug1: identity file /dev/null type -1

debug1: identity file /dev/null-cert type -1

debug1: Local version string SSH-2.0-OpenSSH_8.1p1-PKIXSSH-12.3-hpn14v20 PKIX[12.3]

protocol identification string lack carriage return

debug1: Remote protocol version 2.0, remote software version -

debug1: no match: -

debug1: x.509 compatibility rfc6187_missing_key_identifier=no: pattern '*' match '-'

debug1: x.509 compatibility rfc6187_asn1_opaque_ecdsa_signature=no: pattern '*' match '-'

debug1: x.509 compatibility broken list with accepted publickey algorithms=no: pattern '*' match '-'

debug1: Authenticating to x.x.x.x:22 as 'xxxxx'

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: AUTH STATE IS 0

debug1: kex: algorithm: diffie-hellman-group14-sha1

debug1: kex: host key algorithm: ecdsa-sha2-nistp521

debug1: REQUESTED ENC.NAME is 'aes128-ctr'

debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: zlib

debug1: REQUESTED ENC.NAME is 'aes128-ctr'

debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: zlib

debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

debug1: Server host key: ecdsa-sha2-nistp521 SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxx

debug1: Host 'x.x.x.x' is known and matches the ECDSA host key.

debug1: Found key in /home/xxxxx/.ssh/known_hosts:190

debug1: Enabling compression at level 6.

debug1: rekey out after 67108864 blocks

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: rekey in after 67108864 blocks

debug1: Will attempt key: '*' xxxxx@xxxxx ED25519 SHA256:xxxxxxxxxxxxxxxxxxxxxxxxx agent

debug1: Will attempt key: '*' /dev/null  explicit

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,keyboard-interactive,password

debug1: Next authentication method: keyboard-interactive

User Authentication

Password:

debug1: Single to Multithread CTR cipher swap - client request

debug1: Authentication succeeded (keyboard-interactive).

Authenticated to x.x.x.x ([x.x.x.x]:22).

debug1: Final hpn_buffer_size = 2097152

debug1: HPN Disabled: 0, HPN Buffer Size: 2097152

debug1: channel 0: new [client-session]

debug1: Enabled Dynamic Window Scaling

debug1: enqueue packet: 90

debug1: SSH2_MSG_KEXINIT sent

debug1: Entering interactive session.

debug1: pledge: network

debug1: rekeying in progress

debug1: rekeying in progress

Received disconnect from x.x.x.x port 22: reason 2 - The connection is closed by SSH server

```

Thanks in advance for any return.

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]Last edited by y351 on Wed Sep 23, 2020 10:29 am; edited 1 time in total

----------

## alamahant

Hi 

i see in your openssh client

```

debug1: rekeying in progress

debug1: rekeying in progress

```

Maybe try

```

RekeyIntervalSeconds 0

```

in /etc/ssh/ssh_config.

This is the client config.

If that does not work then please check puty config file to see how the client is implemented.

Use your intuition and compare it with opessh client config.

If it works then in order not to mess with your global ssh config maybe you can create an entry in

~/.ssh/config like this

```

Host switch

     HostName <switch-ip>

     RekeyIntervalSeconds 0

```

 :Very Happy: 

----------

## Princess Nell

One thing I found with Cisco switches was that if you use ssh-agent and have a few keys added, it's a good idea to specify -o IdentitiesOnly=yes on the ssh command line (or in .ssh/config).

----------

## toralf

 *Princess Nell wrote:*   

> One thing I found with Cisco switches was that if you use ssh-agent and have a few keys added, it's a good idea to specify -o IdentitiesOnly=yes on the ssh command line (or in .ssh/config).

 I had to use that configure option too after I created ed the 7th ssh key b/c after the 6th attempt of ssh to choose try a lgin with one of the existing keys my hoster rejected me for a minute or so.

----------

## y351

```
RekeyIntervalSeconds 0 
```

The option is no more used.

----------

## y351

```
RekeyLimit 1G 1h
```

Already tried but still KO.

----------

## y351

```
net-misc/openssh -hpn to /etc/portage/package.use
```

is the solution.

----------

## toralf

 *y351 wrote:*   

> 
> 
> ```
> net-misc/openssh -hpn to /etc/portage/package.use
> ```
> ...

 ? is "hpn" switched on per default ?? What profile do you use ?

----------

## y351

 *toralf wrote:*   

>  *y351 wrote:*   
> 
> ```
> net-misc/openssh -hpn to /etc/portage/package.use
> ```
> ...

 

I did switched it on for any reason but i did not remembered why...

----------

## toralf

In the past Gentoo forced "+hpn" - but that patch was never accepted upstream so the force ("+") was removed fortunately finally.

BTW there's no need for you to set "-hpn", just removing it from your USE föags should be fine.

----------

