ssh - WHM 终端帮助 - SWAP 文件删除
问题描述
我只是想在 DigitalOcean 上设置一个 WHM/cPanel 用于教育目的。
我找到了这个链接来保护 WHM - https://www.pickaweb.co.uk/kb/cpanel-whm-server-security/
将运行此命令
vi /etc/ssh/sshd_config
我遇到错误(我之前尝试过该命令,但我没有保存就断开了连接)
E325: ATTENTION
Found a swap file by the name "/etc/ssh/.sshd_config.swp"
owned by: root dated: Tue Oct 16 13:18:49 2018
file name: /etc/ssh/sshd_config
modified: YES
user name: root host name: host.enrich.press
process ID: 13934
While opening file "/etc/ssh/sshd_config"
dated: Tue Oct 16 14:45:07 2018
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.
"/etc/ssh/sshd_config" 140L, 3944C
Press ENTER or type command to continue
我该如何处理?
解决方案
您很可能错误地退出了 vim(停止作业并将其置于后台),或者您有另一个终端也在编辑相同的文件。简而言之,vim 在您编辑文件时创建交换文件,在该文件中写入更改,并在您退出 vim 后删除该文件,即停止进程。所以你有几个选择:
- 关闭 vim 的另一个实例并再次打开文件
- 例如,如果您已使用 ctrl+z 停止 vim,然后执行,
jobs
那么您将获得一个列表,其中包含正在运行的事物名称前面的数字,一旦知道作业的编号,只需执行fg 1
或无论数字是多少 - (不是很好,但有时是必要的)删除.swp文件并再次打开文件
希望这可以帮助!
推荐阅读
- python - Pandas:在类型为列表的列上应用过滤器功能
- go - 使用反射访问golang中包的私有字段
- python - 需要 Geopandas 数据集的 FuncAnimation 结果
- javascript - package.json 中的 main/module 和条件导出有什么区别?
- python - Firebase 云函数 stderr: /usr/bin/env: 'python': 没有这样的文件或目录
- firebase - @JsonKey 如何访问 Map 的元素,颤动
- magento2 - Magento 2.4 自定义类别属性在 category->getParents() 返回的类别对象上为空
- javascript - 如何仅获取括号 [{}] 内的文本?
- c++ - C++ 将单个二进制 char 转换为 int 数字
- dart - Dart 检查 IP 是否在本地网络 IPv4 或 IPv6 之外