我通过使用命令找到了这个systemctl status ssh
,并且我得到了(死亡)的报告。我的网络似乎很好,ping 8.8.8.8
得到了回应。我在网上的某个地方看到了类似的问题,建议尝试一下grep sshd /var/log/auth.log
。今天的日志如下:
Jan 25 20:28:48 RTIBUSDock sudo: root : TTY=unknown ; PWD=/home/scripts ; USER=root ; COMMAND=/usr/sbin/service ssh start
Jan 25 20:28:49 RTIBUSDock sshd[580]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 25 20:28:49 RTIBUSDock sshd[580]: error: Bind to port 22 on :: failed: Address already in use.
Jan 25 20:28:49 RTIBUSDock sshd[580]: fatal: Cannot bind any address.
Jan 25 20:49:23 RTIBUSDock sshd[1255]: Server listening on 0.0.0.0 port 22.
Jan 25 20:49:23 RTIBUSDock sshd[1255]: Server listening on :: port 22.
Jan 25 20:54:20 RTIBUSDock sudo: root : TTY=ttySAC2 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl enable ssh
Jan 25 20:54:30 RTIBUSDock sshd[1255]: Received signal 15; terminating.
Jan 25 20:56:04 RTIBUSDock sudo: root : TTY=ttySAC2 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl enable ssh.socket
Jan 25 21:00:52 RTIBUSDock sshd[1020]: Server listening on 0.0.0.0 port 22.
Jan 25 21:00:52 RTIBUSDock sshd[1020]: Server listening on :: port 22.
Jan 25 21:01:08 RTIBUSDock sshd[1020]: Received signal 15; terminating.
Jan 25 21:58:01 RTIBUSDock sshd[826]: Server listening on 0.0.0.0 port 22.
Jan 25 21:58:01 RTIBUSDock sshd[826]: Server listening on :: port 22.
这一切都是在将启动卷(在 SD 卡上)从一台计算机移动到另一台计算机后开始发生的。
答案1
固定使用apt-get purge openssh-server && apt-get install openssh-server
.