WHM终端帮助-删除SWAP文件

时间:2018-10-16 14:57:36

标签: ssh terminal cpanel 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

我该如何处理?

1 个答案:

答案 0 :(得分:0)

您很可能错误地退出了vim(停止了作业并将其置于后台),或者您还有另一个终端也在编辑相同的文件。简而言之,vim在编辑文件时会创建交换文件,并在其中写入更改,并且在退出vim时即删除该文件,即停止进程。因此,您有几种选择:

  1. 关闭vim的另一个实例,然后再次打开文件
  2. 例如,如果您已使用ctrl + z停止了vim,请执行jobs,然后您将得到一个列表,其中列出了正在运行的事物的名称,一旦知道了任务的编号,只需执行{ {1}}或任何数字
  3. (不是很好的文件,但有时是必需的)。删除.swp文件,然后再次打开文件。

希望这会有所帮助!