使用 "sudo service sshd restart" 重新启动后,无法使用 linux 终端连接到 AWS 服务器。收到“连接超时”错误

Not able to connect to AWS server using linux terminal after a reboot with "sudo service sshd restart". Getting “Connection timed out” error

我试图编辑 sshd_config 文件,但在这期间我的机器崩溃了。当我再次尝试时,它开始显示以下消息-

Found a swap file by the name "/etc/ssh/.sshd_config.swp"
dated: Mon Oct 23 07:17:17 2017  [cannot be read]
  While opening file "/etc/ssh/sshd_config"
  dated: Mon Oct 23 22:19:04 2017
  NEWER than swap file!

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /etc/ssh/sshd_config"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/etc/ssh/.sshd_config.swp"
    to avoid this message.*

我删除了 .swp 文件,但看起来原始文件已被删除。之后我 运行 这个命令 "sudo service sshd restart ".

现在我无法使用 linux 终端连接到 AWS 服务器。谁能帮我解决这个问题

原始文件不应该被删除....swp 文件是正在进行的编辑。

您是否尝试过重启实例?

如果这没有帮助,您可能需要从快照中恢复。您确实在编辑 ssh 配置之前拍摄了快照,对吗?