大网数据广告活动
服务器运维问答

Strange attempted emails from Cron

· 52CE 我爱测

I use Zoho for my email client and last night I got a couple of notifications saying: Warning! Unverified sender. The system could not verify if this email was sent by [email omitted]. Do not click any links or open any attachmen…

问题原文

原帖链接 · Steve K · CC BY-SA 4.0

I use Zoho for my email client and last night I got a couple of notifications saying:

Warning! Unverified sender. The system could not verify if this email was sent by [email omitted]. Do not click any links or open any attachments, if any, in this email.

The first one was the following:

subject: Cron <root@servername> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
message: run-parts: /etc/cron.daily/do-agent exited with return code 100

and then about an hour later:

subject: Cron <root@servername>    cd / && run-parts --report /etc/cron.hourly
message: run-parts: /etc/cron.hourly/droplet-agent exited with return code 4

Not sure what to make of this. At first I thought someone gained access to my server. But I am not really sure. I am by no means an expert on the server side. This is just my DigitalOcean droplet that I do mostly development on and host a couple personal sites.

So since the message had run-parts: in it if figured I would check out the cron jobs. Here is the contents the cron.daily directory .placeholder apport apt-compat do-agent dpkg logrotate man-db and the cron.hourly folder has the following in it .placeholder droplet-agent. I don't see anything crazy here.

So then looking at the first email I see test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ). But I don't have anacron in my /usr/sbin/ directory.

Does anyone know what is going on here? Is this something I should be worried about? Why am I receiving these emails? I haven't done anything new on here in a quite a while so it's not like I added something new or anything like that.

Update:

Contents of /etc/cron.daily/do-agent

#!/bin/sh
/bin/bash /opt/digitalocean/do-agent/scripts/update.sh >/dev/null 2>&1

Contents of /opt/digitalocean/do-agent/scripts/update.sh

#!/bin/bash
# vim: noexpandtab

REPO_HOST=https://repos.insights.digitalocean.com
REPO_GPG_KEY_CURRENT=${REPO_HOST}/sonar-agent-current.asc

main() {
        # add some jitter to prevent overloading the packaging machines
        sleep $(( RANDOM % 900 ))

        export DEBIAN_FRONTEND="noninteractive"
        if command -v apt-get 2&>/dev/null; then
                curl -sL "${REPO_GPG_KEY_CURRENT}" | apt-key add -
                apt-get -qq update -o Dir::Etc::SourceParts=/dev/null -o APT::Get::List-Cleanup=no -o Dir::Etc::SourceL>
                apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -qq install -y --only>
        elif command -v yum 2&>/dev/null; then
                rpm --import "${REPO_GPG_KEY_CURRENT}"
                yum -q -y --disablerepo="*" --enablerepo="digitalocean-agent" makecache
                yum -q -y update do-agent
        fi
}

main

已采纳解答

原帖链接 · Romeo Ninov · CC BY-SA 4.0

There is nothing strange. The command check if you have /usr/sbin/anacron and if file do not exist or not executable run run-parts for daily cron. And usually cron send mail to root with the job results. If tou want to stop add as first line in cron.daily line like:

MAILTO=

Same about cron.hourly

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2023-04-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。