通过终端错误进行 SFTP

通过终端错误进行 SFTP

我无法再通过 sftp 连接到服务器,昨天还可以。这是完整的 sftp -vvv 日志,也许你能帮我一下?尝试删除 ~/.ssh,尝试 hosts.allow / hosts.deny。根本没有解决办法。

有什么建议么?

sftp -vvvvvv -P 1313 [email protected]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to xx.dyndns.org [xx.xx.xx.xx] port 1313.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/user/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

答案1

我不同意 Aaron 的观点 - 这是正常的行为。参见- 我也刚刚使用 -vvvvv 测试了成功的 SFTP 连接,并收到了相同的消息。

我认为您应该在远程计算机上检查 /var/log/auth.log(如果是 Debian/Ubuntu/等)或 /var/log secure(如果是 RH、Fedora 等)。您应该会看到更具信息性的错误。

还要检查远程服务器上文件的文件权限 - ~/.ssh、~/.ssh/authorized_keys 它们应该可以被您的用户读取,并且 authorized_keys 的权限应为 600。您还能通过 SSH 连接到该服务器吗?

相关内容