【发布时间】:2020-07-25 21:15:38
【问题描述】:
设置:
- Raspberry 3B 在外部 HDD 上运行 Raspbian Stretch 9 并使用 ZRAM
- Raspi 用作运行 LAMP 和 MERN 堆栈的网络服务器,并通过 SSH 和 1 个 IDE(Coda for Mac OS)远程访问
- 静态 IP 路由器转发的 SSH 端口
- fail2ban 运行
问题:
当通过 SSH 从远程位置(通过 Internet)访问树莓派时,它会一直工作,直到连接挂起。这是随机发生的。 有时我可以在几分钟后再次 SSH,有时直到我重新启动 Raspi。
我的尝试:
- 从远程位置以详细模式进行 SSH:
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: read: Connection reset by peer
- 从本地网络以详细模式进行 SSH(我实际上是远程 SSH 本地网络上的另一台机器,然后从那台机器 SSH Raspi)。 结果相同:
Connection reset by peer - 检查了
/etc/hosts.allow和/etc/hosts.deny=> 什么都没有 - 通过
iptables -L --line-number检查 iptables => 那里什么都没有 - 检查的日志:
/var/log/fail2ban.log和sudo journalctl -t sshd=> 没有什么特别的地方 - 将
sshd_config更新为no DNS - 通过
apt-get --reinstall install openssh-server openssh-client重新安装SSH
我的想法已经不多了,也不知道发生了什么。 之前有人遇到过与 SSH 连接相同的问题吗? 会不会是树莓派的负载问题?
【问题讨论】:
-
客户端重启对我有用
标签: ssh raspberry-pi ssh-keys openssh fail2ban