繁体   English   中英

使用“ 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配置之前确实做了快照,对吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM