[GH-ISSUE #3534] 跳板机多因子验证登录失败 #2415

Closed
opened 2026-02-27 00:07:17 +03:00 by kerem · 3 comments
Owner

Originally created by @qiang-l on GitHub (Jul 29, 2024).
Original GitHub issue: https://github.com/electerm/electerm/issues/3534

Electerm Version and download file extension(Electerm版本和下载文件后缀)

electerm-1.39.88-linux-x86_64.AppImage

Platform detail (平台详情)

Linux yt 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

What steps will reproduce the bug?(重新问题的详细步骤)

测试连接时报错 connection fails: Failed to execute 'postMessage' on 'Worker': [object Array] could not be cloned.
连接时弹出 Option> P 之前都是弹出类似 MFA Code

另外
没有多因子验证的跳板机能正常登录
使用命令行ssh 能正常登录

从debug日志来看 问题好像是在password认证那块
附debug日志
v6 dns lookup error: queryAaaa ENODATA xxx.com
11:14:53 info › Custom crypto binding not available
11:14:53 info › Local ident: 'SSH-2.0-ssh2js1.15.0'
11:14:53 info › Client: Trying xxx.com on port xxx ...
11:14:53 info › Socket connected
11:14:53 info › Remote ident: 'SSH-2.0-Go'
11:14:53 info › Outbound: Sending KEXINIT
11:14:53 info › Inbound: Handshake in progress
11:14:53 info › Handshake: (local) KEX method: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,ext-info-c,kex-strict-c-v00@openssh.com
11:14:53 info › Handshake: (remote) KEX method: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,kex-strict-s-v00@openssh.com
11:14:53 info › Handshake: strict KEX mode enabled
11:14:53 info › Handshake: KEX algorithm: curve25519-sha256
11:14:53 info › Handshake: (local) Host key format: ssh-ed25519,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
11:14:53 info › Handshake: (remote) Host key format: rsa-sha2-256,rsa-sha2-512,ssh-rsa
11:14:53 info › Handshake: Host key format: ssh-rsa
11:14:53 info › Handshake: (local) C->S cipher: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com,aes256-cbc,aes192-cbc,aes128-cbc,aes128-ctr,aes192-ctr,aes256-ctr,blowfish-cbc,3des-cbc,arcfour256,arcfour128,arcfour
11:14:53 info › Handshake: (remote) C->S cipher: aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
11:14:53 info › Handshake: C->S Cipher: aes128-ctr
11:14:53 info › Handshake: (local) S->C cipher: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com,aes256-cbc,aes192-cbc,aes128-cbc,aes128-ctr,aes192-ctr,aes256-ctr,blowfish-cbc,3des-cbc,arcfour256,arcfour128,arcfour
11:14:53 info › Handshake: (remote) S->C cipher: aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
11:14:53 info › Handshake: S->C cipher: aes128-ctr
11:14:53 info › Handshake: (local) C->S MAC: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha2-256-96,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com
11:14:53 info › Handshake: (remote) C->S MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1
11:14:53 info › Handshake: C->S MAC: hmac-sha2-256
11:14:53 info › Handshake: (local) S->C MAC: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha2-256-96,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com
11:14:53 info › Handshake: (remote) S->C MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1
11:14:53 info › Handshake: S->C MAC: hmac-sha2-256
11:14:53 info › Handshake: (local) C->S compression: none,zlib@openssh.com,zlib
11:14:53 info › Handshake: (remote) C->S compression: none
11:14:53 info › Handshake: C->S compression: none
11:14:53 info › Handshake: (local) S->C compression: none,zlib@openssh.com,zlib
11:14:53 info › Handshake: (remote) S->C compression: none
11:14:53 info › Handshake: S->C compression: none
11:14:53 info › Outbound: Sending KEXECDH_INIT
11:14:53 info › Received DH Reply
11:14:53 info › Host accepted by default (no verification)
11:14:53 info › Host accepted (verified)
11:14:53 info › Outbound: Sending NEWKEYS
11:14:53 info › Inbound: NEWKEYS
11:14:53 info › Verifying signature ...
11:14:53 info › Verified signature
11:14:53 info › Handshake completed
11:14:53 info › Outbound: Sending SERVICE_REQUEST (ssh-userauth)
11:14:53 info › Inbound: Received EXT_INFO
11:14:53 info › Inbound: Received SERVICE_ACCEPT (ssh-userauth)
11:14:53 info › Outbound: Sending USERAUTH_REQUEST (none)
11:14:53 info › Inbound: Received USERAUTH_FAILURE (password,publickey)
11:14:53 info › Client: none auth failed
11:14:53 info › Outbound: Sending USERAUTH_REQUEST (password)
11:14:53 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive)
11:14:53 info › Client: password auth failed
11:14:53 info › Agent: Trying key #1
11:14:53 info › Outbound: Sending USERAUTH_REQUEST (publickey -- check)
11:14:54 info › Inbound: Received USERAUTH_PK_OK
11:14:54 info › Outbound: Sending USERAUTH_REQUEST (publickey)
11:14:54 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive)
11:14:54 info › Client: agent (rsa-sha2-256) auth failed
11:14:54 info › Client: Agent key #1 failed
11:14:54 info › Agent: Trying key #2
11:14:54 info › Outbound: Sending USERAUTH_REQUEST (publickey -- check)
11:14:54 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive)
11:14:54 info › Client: agent (rsa-sha2-256) auth failed
11:14:54 info › Client: Agent key #2 failed
11:14:54 info › Agent: No more keys left to try
11:14:54 info › Client: agent auth failed
11:14:54 info › Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)
11:14:54 info › Inbound: Received USERAUTH_INFO_REQUEST
11:15:05 info › Outbound: Sending USERAUTH_INFO_RESPONSE
11:15:05 info › Inbound: Received USERAUTH_INFO_REQUEST
11:15:12 info › Outbound: Sending USERAUTH_INFO_RESPONSE
11:15:12 info › Inbound: Received USERAUTH_INFO_REQUEST
11:15:43 error › error when do sshConnect Error: Timed out while waiting for handshake
at Timeout._onTimeout (/tmp/.mount_electeniD6Hl/resources/app.asar/node_modules/ssh2/lib/client.js:1116:23)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) null
11:15:43 info › Socket closed
11:15:43 error › fetch error {
message: 'Timed out while waiting for handshake',
stack: 'Error: Timed out while waiting for handshake\n' +
' at Timeout._onTimeout (/tmp/.mount_electeniD6Hl/resources/app.asar/node_modules/ssh2/lib/client.js:1116:23)\n' +
' at listOnTimeout (node:internal/timers:569:17)\n' +
' at process.processTimers (node:internal/timers:512:7)'
}
11:15:43 debug › { message: 'Timed out while waiting for handshake' }
11:15:43 debug › Timed out while waiting for handshake fetch err info

What should have happened?(期望的结果)

如上

Would this happen in other terminal app(是否能够在其他同类软件重现这个问题)

No response

Additional information(其他任何相关信息)

No response

Originally created by @qiang-l on GitHub (Jul 29, 2024). Original GitHub issue: https://github.com/electerm/electerm/issues/3534 ### Electerm Version and download file extension(Electerm版本和下载文件后缀) electerm-1.39.88-linux-x86_64.AppImage ### Platform detail (平台详情) Linux yt 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ### What steps will reproduce the bug?(重新问题的详细步骤) 测试连接时报错 connection fails: Failed to execute 'postMessage' on 'Worker': [object Array] could not be cloned. 连接时弹出 Option> P 之前都是弹出类似 MFA Code 另外 没有多因子验证的跳板机能正常登录 使用命令行ssh 能正常登录 从debug日志来看 问题好像是在password认证那块 附debug日志 v6 dns lookup error: queryAaaa ENODATA xxx.com 11:14:53 info › Custom crypto binding not available 11:14:53 info › Local ident: 'SSH-2.0-ssh2js1.15.0' 11:14:53 info › Client: Trying xxx.com on port xxx ... 11:14:53 info › Socket connected 11:14:53 info › Remote ident: 'SSH-2.0-Go' 11:14:53 info › Outbound: Sending KEXINIT 11:14:53 info › Inbound: Handshake in progress 11:14:53 info › Handshake: (local) KEX method: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,ext-info-c,kex-strict-c-v00@openssh.com 11:14:53 info › Handshake: (remote) KEX method: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,kex-strict-s-v00@openssh.com 11:14:53 info › Handshake: strict KEX mode enabled 11:14:53 info › Handshake: KEX algorithm: curve25519-sha256 11:14:53 info › Handshake: (local) Host key format: ssh-ed25519,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss 11:14:53 info › Handshake: (remote) Host key format: rsa-sha2-256,rsa-sha2-512,ssh-rsa 11:14:53 info › Handshake: Host key format: ssh-rsa 11:14:53 info › Handshake: (local) C->S cipher: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com,aes256-cbc,aes192-cbc,aes128-cbc,aes128-ctr,aes192-ctr,aes256-ctr,blowfish-cbc,3des-cbc,arcfour256,arcfour128,arcfour 11:14:53 info › Handshake: (remote) C->S cipher: aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr 11:14:53 info › Handshake: C->S Cipher: aes128-ctr 11:14:53 info › Handshake: (local) S->C cipher: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com,aes256-cbc,aes192-cbc,aes128-cbc,aes128-ctr,aes192-ctr,aes256-ctr,blowfish-cbc,3des-cbc,arcfour256,arcfour128,arcfour 11:14:53 info › Handshake: (remote) S->C cipher: aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr 11:14:53 info › Handshake: S->C cipher: aes128-ctr 11:14:53 info › Handshake: (local) C->S MAC: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha2-256-96,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com 11:14:53 info › Handshake: (remote) C->S MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1 11:14:53 info › Handshake: C->S MAC: hmac-sha2-256 11:14:53 info › Handshake: (local) S->C MAC: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha2-256-96,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com 11:14:53 info › Handshake: (remote) S->C MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1 11:14:53 info › Handshake: S->C MAC: hmac-sha2-256 11:14:53 info › Handshake: (local) C->S compression: none,zlib@openssh.com,zlib 11:14:53 info › Handshake: (remote) C->S compression: none 11:14:53 info › Handshake: C->S compression: none 11:14:53 info › Handshake: (local) S->C compression: none,zlib@openssh.com,zlib 11:14:53 info › Handshake: (remote) S->C compression: none 11:14:53 info › Handshake: S->C compression: none 11:14:53 info › Outbound: Sending KEXECDH_INIT 11:14:53 info › Received DH Reply 11:14:53 info › Host accepted by default (no verification) 11:14:53 info › Host accepted (verified) 11:14:53 info › Outbound: Sending NEWKEYS 11:14:53 info › Inbound: NEWKEYS 11:14:53 info › Verifying signature ... 11:14:53 info › Verified signature 11:14:53 info › Handshake completed 11:14:53 info › Outbound: Sending SERVICE_REQUEST (ssh-userauth) 11:14:53 info › Inbound: Received EXT_INFO 11:14:53 info › Inbound: Received SERVICE_ACCEPT (ssh-userauth) 11:14:53 info › Outbound: Sending USERAUTH_REQUEST (none) 11:14:53 info › Inbound: Received USERAUTH_FAILURE (password,publickey) 11:14:53 info › Client: none auth failed 11:14:53 info › Outbound: Sending USERAUTH_REQUEST (password) 11:14:53 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive) 11:14:53 info › Client: password auth failed 11:14:53 info › Agent: Trying key #1 11:14:53 info › Outbound: Sending USERAUTH_REQUEST (publickey -- check) 11:14:54 info › Inbound: Received USERAUTH_PK_OK 11:14:54 info › Outbound: Sending USERAUTH_REQUEST (publickey) 11:14:54 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive) 11:14:54 info › Client: agent (rsa-sha2-256) auth failed 11:14:54 info › Client: Agent key #1 failed 11:14:54 info › Agent: Trying key #2 11:14:54 info › Outbound: Sending USERAUTH_REQUEST (publickey -- check) 11:14:54 info › Inbound: Received USERAUTH_FAILURE (keyboard-interactive) 11:14:54 info › Client: agent (rsa-sha2-256) auth failed 11:14:54 info › Client: Agent key #2 failed 11:14:54 info › Agent: No more keys left to try 11:14:54 info › Client: agent auth failed 11:14:54 info › Outbound: Sending USERAUTH_REQUEST (keyboard-interactive) 11:14:54 info › Inbound: Received USERAUTH_INFO_REQUEST 11:15:05 info › Outbound: Sending USERAUTH_INFO_RESPONSE 11:15:05 info › Inbound: Received USERAUTH_INFO_REQUEST 11:15:12 info › Outbound: Sending USERAUTH_INFO_RESPONSE 11:15:12 info › Inbound: Received USERAUTH_INFO_REQUEST 11:15:43 error › error when do sshConnect Error: Timed out while waiting for handshake at Timeout._onTimeout (/tmp/.mount_electeniD6Hl/resources/app.asar/node_modules/ssh2/lib/client.js:1116:23) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) null 11:15:43 info › Socket closed 11:15:43 error › fetch error { message: 'Timed out while waiting for handshake', stack: 'Error: Timed out while waiting for handshake\n' + ' at Timeout._onTimeout (/tmp/.mount_electeniD6Hl/resources/app.asar/node_modules/ssh2/lib/client.js:1116:23)\n' + ' at listOnTimeout (node:internal/timers:569:17)\n' + ' at process.processTimers (node:internal/timers:512:7)' } 11:15:43 debug › { message: 'Timed out while waiting for handshake' } 11:15:43 debug › Timed out while waiting for handshake fetch err info ### What should have happened?(期望的结果) 如上 ### Would this happen in other terminal app(是否能够在其他同类软件重现这个问题) _No response_ ### Additional information(其他任何相关信息) _No response_
kerem 2026-02-27 00:07:17 +03:00
Author
Owner

@qiang-l commented on GitHub (Jul 30, 2024):

问题已解决 操作是
1.生成密钥对id_ed25519
2.向~/.ssh/config 追加 IdentityFile ~/.ssh/id_ed25519
3.在跳板机更换id_ed25519密钥(原先是id_rsa)

虽然解决了问题 但是原因还是查不出来
可能和密钥有点关系 但是有password还登录失败 就有点奇怪
如果后面有人碰到类似问题 希望这次踩坑能提供点帮助
@zxdong262

<!-- gh-comment-id:2258008756 --> @qiang-l commented on GitHub (Jul 30, 2024): 问题已解决 操作是 1.生成密钥对id_ed25519 2.向~/.ssh/config 追加 IdentityFile ~/.ssh/id_ed25519 3.在跳板机更换id_ed25519密钥(原先是id_rsa) 虽然解决了问题 但是原因还是查不出来 可能和密钥有点关系 但是有password还登录失败 就有点奇怪 如果后面有人碰到类似问题 希望这次踩坑能提供点帮助 @zxdong262
Author
Owner

@qiang-l commented on GitHub (Aug 9, 2024):

登录失败的现象又出现了
怀疑是config文件造成的
把.ssh文件改名 然后再连接 就正常了
(猜测是config文件里的内容影响了登录?)

$ ls ~/.ssh
company company.pub config id_ed25519 id_ed25519.pub id_rsa id_rsa.pub known_hosts
$ cat ~/.ssh/config
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/company
IdentityFile ~/.ssh/id_ed25519

<!-- gh-comment-id:2277167973 --> @qiang-l commented on GitHub (Aug 9, 2024): 登录失败的现象又出现了 怀疑是config文件造成的 把.ssh文件改名 然后再连接 就正常了 (猜测是config文件里的内容影响了登录?) $ ls ~/.ssh company company.pub config id_ed25519 id_ed25519.pub id_rsa id_rsa.pub known_hosts $ cat ~/.ssh/config IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/company IdentityFile ~/.ssh/id_ed25519
Author
Owner

@zxdong262 commented on GitHub (Aug 9, 2024):

如果不指定密码或者私钥内容会挨个读取.ssh里面的私钥尝试登录

<!-- gh-comment-id:2277176666 --> @zxdong262 commented on GitHub (Aug 9, 2024): 如果不指定密码或者私钥内容会挨个读取.ssh里面的私钥尝试登录
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/electerm#2415
No description provided.