【问题标题】:sshd connection issue: Connection reset by [ip] port x [preauth]sshd 连接问题:通过 [ip] 端口 x [preauth] 重置连接
【发布时间】:2021-10-10 16:59:52
【问题描述】:

我在尝试从 Windows 客户端 sftp 到我的 redhat 服务器时看到以下错误消息:

客户:

C:\Users\Administrator\.ssh>sftp -P 7822 -v user@x.x.x.x
.
.
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:FczboY8BDSWtdA87euFDWSDrwBNRMbYzHUR3VmMpbk 
C:\\Users\\Administrator/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: C:\\Users\\Administrator/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\Administrator/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\Administrator/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\Administrator/.ssh/id_xmss
debug1: No more authentication methods to try.
user@x.x.x.x Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

服务器:

Aug  4 23:27:09 3oy1jxwr1k81l.xxx.io sshd[16064]: Connection reset by x.x.x.x port 65256 [preauth]
Aug  4 23:27:14 3oy1jxwr1k81l.xxx.io sshd[16117]: Did not receive identification string from x.x.x.x port 12593
Aug  4 23:27:24 3oy1jxwr1k81l.xxx.io sshd[16259]: Did not receive identification string from x.x.x.x port 48329
Aug  4 23:27:34 3oy1jxwr1k81l.xxx.io sshd[16394]: Did not receive identification string from x.x.x.x port 2040

我确信所有端口都在防火墙中打开,并且授权密钥设置正确。 所以我停止了 sshd 服务,并使用 -ddd 从 cmd 行运行,希望获得更多信息。

但是在调试模式下运行时,连接成功!?!?

/user/sbin/sshd -D -ddd

客户:

C:\Users\Administrator\.ssh>sftp -P 7822 user@x.x.x.x
Connected to user@x.x.x.x.
sftp> exit

任何想法可能会发生什么? (注意这是 100% 可重现的,每次 sshd 正常运行时都会失败,使用 -ddd 运行时总是成功)

【问题讨论】:

    标签: sshd


    【解决方案1】:

    看来问题是由于服务器上的用户主目录中缺少 .bash_profile。

    重新添加用户配置文件后,问题似乎解决了。

    为什么 sshd 不在乎在调试模式下运行时丢失它似乎是 sshd 中的一个错误。

    【讨论】:

      【解决方案2】:

      我也收到了Connection reset by [ip] port x [preauth] 消息。

      然而,对我来说,这是客户端的防火墙问题。 IT 部门在网络之外阻止了 SSH。更新防火墙后,连接正常。

      【讨论】:

        猜你喜欢
        • 2022-01-05
        • 2011-03-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-26
        • 1970-01-01
        • 1970-01-01
        • 2017-01-13
        相关资源
        最近更新 更多