linux - Not able to connect to AWS server using linux terminal after a reboot with "sudo service sshd restart". Getting “Connection timed out” error
问题描述
I was trying to edit the sshd_config file and in between that my machine crashed. When I tried again it started showing the below message-
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.*
I deleted the .swp file but it looks like the original file got deleted. After that I ran this command "sudo service sshd restart ".
Now I am not able to connect to the AWS server using linux terminal. Can anyone please help me with this
解决方案
原始文件不应该被删除...... .swp 文件是正在进行的编辑。
您是否尝试过重启实例?
如果这没有帮助,您可能需要从快照中恢复。您确实在编辑 ssh 配置之前拍摄了快照,对吧?
推荐阅读
- asp.net-core - ASP .NET Core 2 中的字符串修剪模型绑定器
- jenkins - 简单的 Jenkins 管道项目失败
- html - 在 CSS 中添加具有不透明度的背景图像
- python - 如何管理大尺寸文件?
- c# - 旋转 PictureBox 正在裁剪图像
- go - 转到 http api 服务器和 socket.io
- azure-maps - 如何将 Azure Maps 密钥限制为域名?
- php - php中的文件上传突然无法正常工作
- wpf - 将从 ListView PS 中的选定列中提取数据的事件侦听器
- python - 将 csv 写入 tarfile 但内部没有扩展名