WHM 终端帮助 - 交换文件删除



我只是想在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 后删除该文件,即停止进程。因此,您有以下几种选择:

  1. 关闭 vim 的另一个实例并再次打开文件
  2. 例如,如果你用ctrl + z停止了vim,执行jobs那么你将得到一个列表,在正在运行的事物的名称前面带有数字,一旦知道作业的编号,只需执行fg 1或任何数字是什么
  3. (不是一个好的,但有时是必要的(删除 .swp 文件并再次打开该文件

希望这有帮助!

最新更新