我们正在使用一个EC2(Ubuntu)amazon实例来运行Apache.最近我们注意到有一个进程使用整个CPU.

enter image description here

我们通过以下步骤将其移除

[root@hadoop002 tmp]# systemctl status 25177
● session-5772.scope - Session 5772 of user root
   Loaded: loaded (/run/systemd/system/session-5772.scope; static; vendor preset: disabled)
  Drop-In: /run/systemd/system/session-5772.scope.d
           └─50-After-systemd-logind\x2eservice.conf, 50-After-systemd-user-sessions\x2eservice.conf, 50-Description.conf, 50-SendSIGHUP.conf, 50-Slice.conf, 50-TasksMax.conf
   Active: active (abandoned) since Wed 2020-01-22 16:06:01 CST; 1h 21min ago
   CGroup: /user.slice/user-0.slice/session-5772.scope
           ├─19331 /var/tmp/kinsing
           └─25177 /tmp/kdevtmpfsi

Jan 22 16:06:17 hadoop002 crontab[19353]: (root) REPLACE (root)
Jan 22 16:06:17 hadoop002 crontab[19354]: (root) LIST (root)
Jan 22 16:06:17 hadoop002 crontab[19366]: (root) LIST (root)
Jan 22 16:06:17 hadoop002 crontab[19374]: (root) REPLACE (root)
Jan 22 16:06:17 hadoop002 crontab[19375]: (root) LIST (root)
Jan 22 16:06:17 hadoop002 crontab[19383]: (root) REPLACE (root)
Jan 22 16:06:17 hadoop002 crontab[19389]: (root) REPLACE (root)
Jan 22 16:06:17 hadoop002 crontab[19390]: (root) LIST (root)
Jan 22 16:06:17 hadoop002 crontab[19392]: (root) REPLACE (root)
Jan 22 16:06:17 hadoop002 crontab[19393]: (root) LIST (root)
[root@hadoop002 tmp]# ps -ef|grep kinsing
root     19331     1  0 16:06 ?        00:00:04 /var/tmp/kinsing
root     25190 23274  0 17:27 pts/0    00:00:00 grep --color=auto kinsing
[root@hadoop002 tmp]# ps -ef|grep kdevtmpfsi
root     25177     1 99 17:27 ?        00:01:47 /tmp/kdevtmpfsi
root     25197 23274  0 17:28 pts/0    00:00:00 grep --color=auto kdevtmpfsi
[root@hadoop002 tmp]# kill -9 19331
[root@hadoop002 tmp]# kill -9 25177
[root@hadoop002 tmp]# rm -rf kdevtmpfsi
[root@hadoop002 tmp]# cd /var/tmp/
[root@hadoop002 tmp]# ll
total 16692
-rw-r--r-- 1 root root        0 Jan 13 19:45 aliyun_assist_update.lock
-rwxr-xr-x 1 root root    13176 Dec 20 02:14 for
-rwxr-xr-x 1 root root 17072128 Jan 19 17:43 kinsing
drwx------ 3 root root     4096 Jan 13 19:50 systemd-private-f3342ea6023044bda27f0261d2582ea3-chronyd.service-O7aPIg
[root@hadoop002 tmp]# rm -rf kinsing

但几分钟后,它又自动启动了.有人知道怎么解决这个问题吗?

推荐答案

这里提到的解决方案对我们有效.您基本上创建了矿工使用的文件,没有任何权限,因此矿工无法创建和使用它们.

touch /tmp/kdevtmpfsi && touch /var/tmp/kinsing

echo "everything is good here" > /tmp/kdevtmpfsi

echo "everything is good here" > /var/tmp/kinsing

touch /tmp/zzz

echo "everything is good here" > /tmp/zzz

chmod go-rwx /var/tmp

chmod 1777 /tmp

Linux相关问答推荐

在正在运行的进程的输出周围添加自定义字符串

命令行中使用`..`为什么会导致权限被拒绝错误?

线程创建会在 Linux 中触发页面错误吗?它与软脏 PTE 有什么关系?

替换前 3 个字符范围内的所有整数

为什么rsp寄存器从0x7FFFFFFFDFD0开始

Linux 系统调用文档

当 skylake 有 fsgsbase 时,为什么使用 __builtin_ia32_wrfsbase64 会收到非法指令?

Linux上Kvaser数据库编辑器的等效工具

bash 更有效的方法来转换奇数日期格式以被 linux 日期识别

判断条件是否为假

如何在 Linux 中使用命令行将 PDF 转换为 JPG?

Linux 上的 C++ 开发 - 我从哪里开始?

如何像 Nautilus 那样从命令行挂载?

如何将输出从 grep 传送到 cp?

如何从任意 pthread_t 获取线程 ID?

用于 ssh 的类似 teamviewer 的工具?

grep 递归查找 Linux 上的特定文件类型

如何获取 GNU Makefile 中使用的 shell 命令的退出状态?

在 Linux 上更新 PyCharm

在 Docker 容器中运行的 JVM 的驻留集大小 (RSS) 和 Java 总提交内存 (NMT) 之间的差异