我想在我的树莓设备上的两个端口上运行 SSHd。我已经添加
Port 22
Port 5500
Run Code Online (Sandbox Code Playgroud)
到/etc/ssh/sshd_config
,然后跑了/etc/init.d/ssh restart
。
问题是,端口 5500 上的连接总是被重置。
我可以在这里看到可能的问题:(它正在以用户身份收听pi
)。不知道这怎么会发生。
> lsof -i
sshd 7727 pi 3u IPv4 13512 0t0 TCP *:5500 (LISTEN)
sshd 8122 root 3u IPv4 15032 0t0 TCP *:ssh (LISTEN)
Run Code Online (Sandbox Code Playgroud)
此外,其他输出:
> ssh localhost -p 5500 -v
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
来自 /var/log/auth.log
> tail /var/auth/auth.log
Dec 1 18:01:18 usoplesk sshd[8297]: error: Could not load host …
Run Code Online (Sandbox Code Playgroud) ssh ×1