AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1678830
Accepted
stiw47
stiw47
Asked: 2021-09-29 23:33:02 +0800 CST2021-09-29 23:33:02 +0800 CST 2021-09-29 23:33:02 +0800 CST

“服务器拒绝我们的密钥”仅来自 MobaXterm 书签设置

  • 772

有一个非常奇怪的问题,我自己无法解决。

带有 openssh 8.8p1-1 的 Archlinux 服务器我没有使用密码进行身份验证,只使用 SSH-RSA 密钥。公钥存储在 /home/stiw47/.ssh/authorized_keys 内的服务器上 .ssh 目录权限为 700,authorized_keys 文件权限为 600 多年来一切都完美无缺,直到几天前服务器上的 openssh 从 8.7p1-2 更新到8.8p1-1 除 MobaXterm 外,所有 ssh/sftp 客户端中的一切仍在运行。

让我试着更好地解释一下:

  • 如果我尝试从 FileZilla (sftp) 或 Android 上的 JuiceSSH (ssh) 进行连接,那么与所有这些年来一样,使用相同的私钥一切正常。
  • 如果我尝试从其他 Linux 机器上的终端或 MobaXterm 终端手动连接,手动我的意思是使用命令:ssh -i 'C:\Users\stiw4\Documents\keys\id_rsa' [email protected]- 一切正常
  • 如果我尝试在 MobaXterm 中使用书签(我喜欢书签),则会收到“服务器拒绝我们的密钥”消息

MobaXterm 书签区截图

我不得不提到同样的书签,使用相同的私钥,在服务器上的 openssh 包升级之前正常工作,如果我将服务器上的 openssh 降级回 8.7p1-2,现在也可以工作我已经删除了 Windows 机器上的 MobaXterm known_hosts 文件,但没有改变了。

我试图通过在服务器上运行以下命令来调试它:

sudo `which sshd` -p 2020 -Dd

从 2020 端口上的书签连接,这是日志,我不太理解:

[sudo] password for stiw47:
debug1: sshd version OpenSSH_8.8, OpenSSL 1.1.1l  24 Aug 2021
debug1: private host key #0: ssh-rsa SHA256:uMBMgYez8RvbToK8ZpuVIOT6Kt9DtjwvEEmObduXSaw
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:s/mpg8gbKeFRefGxYjuHYgXFkL8KrklpgivPk9veSXI
debug1: private host key #2: ssh-ed25519 SHA256:MopYaB4XAi8QBkE+RumfZl6IT3y17c3Mu85X+11+wRY
debug1: rexec_argv[0]='/usr/bin/sshd'
debug1: rexec_argv[1]='-p'
debug1: rexec_argv[2]='2020'
debug1: rexec_argv[3]='-Dd'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 2020 on 0.0.0.0.
Server listening on 0.0.0.0 port 2020.
debug1: Bind to port 2020 on ::.
Server listening on :: port 2020.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: sshd version OpenSSH_8.8, OpenSSL 1.1.1l  24 Aug 2021
debug1: private host key #0: ssh-rsa SHA256:uMBMgYez8RvbToK8ZpuVIOT6Kt9DtjwvEEmObduXSaw
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:s/mpg8gbKeFRefGxYjuHYgXFkL8KrklpgivPk9veSXI
debug1: private host key #2: ssh-ed25519 SHA256:MopYaB4XAi8QBkE+RumfZl6IT3y17c3Mu85X+11+wRY
debug1: inetd sockets after dupping: 3, 3
Connection from 192.168.0.53 port 50385 on 192.168.0.21 port 2020 rdomain ""
debug1: Local version string SSH-2.0-OpenSSH_8.8
debug1: Remote protocol version 2.0, remote software version MoTTY_Release_0.73
debug1: compat_banner: no match: MoTTY_Release_0.73
debug1: permanently_set_uid: 65534/65534 [preauth]
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256 [preauth]
debug1: kex: host key algorithm: ssh-ed25519 [preauth]
debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha2-256 compression: none [preauth]
debug1: kex: server->client cipher: aes256-ctr MAC: hmac-sha2-256 compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_DH_GEX_REQUEST [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent [preauth]
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_INIT received [preauth]
debug1: rekey out after 4294967296 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey in after 4294967296 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user stiw47 service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "stiw47"
debug1: PAM: setting PAM_RHOST to "192.168.0.53"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user stiw47 service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
Received disconnect from 192.168.0.53 port 50385:14: No supported authentication methods available [preauth]
Disconnected from authenticating user stiw47 192.168.0.53 port 50385 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: PAM: cleanup
debug1: Killing privsep child 64262

对我来说很奇怪的情况,你有什么想法吗?

谢谢。

ssh openssh
  • 1 1 个回答
  • 3896 Views

1 个回答

  • Voted
  1. Best Answer
    Kaeltis
    2021-10-05T10:41:41+08:002021-10-05T10:41:41+08:00

    这是由 OpenSSH 8.8 使用 SHA-1 哈希算法禁用 RSA 签名引起的:

    此版本默认使用 SHA-1 哈希算法禁用 RSA 签名。由于 SHA-1 哈希算法在密码上被破坏,因此已进行此更改,并且可能会为 <USD$50K 创建选择前缀哈希冲突

    (请参阅OpenSSH 8.8 - 可能不兼容的更改)。

    您还可以在提供的日志中看到相应的消息:

    userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]

    这些旧密钥的功能可以通过添加并重新启动 sshdPubkeyAcceptedKeyTypes +ssh-rsa来恢复。然而,由于安全隐患,/etc/ssh/sshd_config这只能被视为一种临时解决方案,以使用更现代和更安全的算法(如 Ed25519(参见ArchWiki - SSH 密钥 - Ed25519 ))替换密钥。

    他们的密钥从终端工作的原因似乎是 SSH 协议的更新实现(与 MobaXterm 中使用的协议相比),它自动使用 SHA-256/512 而不是 SHA-1 和这些旧密钥。我无法验证这一点,但根据OpenSSH 8.8 - 可能不兼容的更改:

    [...] 现有的 ssh-rsa 密钥将尽可能自动使用更强的算法。

    • 4

相关问题

  • 如何使用 GUI 远程访问 EC2 控制台

  • 需要 LDAP 身份验证 * 和 * ssh 身份验证

  • 加载密钥“ec256.pem”:尝试从私钥生成公钥时抛出无效格式

  • 为什么 chown 600 id_rsa 修复权限问题?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve