this post was submitted on 13 Aug 2025
45 points (95.9% liked)

Selfhosted

61512 readers
849 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

When I sshed into my server today, it said I had mail. I checked /var/mail/{myuser} and got a mail from caddy. The title was "SECURITY information for {hostname}". The message was this.

caddy : user NOT in sudoers ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /usr/local/share/ca-certificates/Caddy_Local_Authority_-_2025_ECC_Root_31435960950297150297199787413716908247066220.crt

I'm still learning this self-hosting thing, I know enough to set stuff up but I still know barely anything about security, and the message looks kinda scary, so I would like to know what it means, thanks in advance. Note that I was messing around with Caddy and stuff yesterday, so maybe that has something to do with it, but I'm not sure.

all 12 comments
sorted by: hot top controversial new old
[–] rtxn@lemmy.world 64 points 1 year ago* (last edited 1 year ago) (1 children)

I can't believe it. The incident has actually been reported!


I don't use Caddy, but it seems like it tried to generate and write a TLS certificate into /usr/local, but didn't have the necessary permissions. Basically it tried to use sudo tee ... to write a file. Is Caddy running in a container? If it is, you might need to create a volume at /usr/local/share/ca-certificates. If not in a container, you'll need to grant the caddy user write permissions in that directory.

But to answer your question directly, it's not a cause for concern. You're not getting hacked, it's just a configuration error.

[–] sugar_in_your_tea@sh.itjust.works 2 points 1 year ago (1 children)

Caddy should never run sudo IMO, I think it's also a software bug.

[–] jrgd@lemmy.zip 19 points 1 year ago (1 children)

You're likely looking for this docs section for Caddy. The failure is the automated request to populate Caddy's root CA cert to the host system, but obviously failed as it doesn't have root permissions. As the docs state, if you intend to use the local HTTPS functionality of Caddy, you can manually run caddy trust privileged in order to populate the Caddy root CA cert manually. If you intend to disable the local HTTPS functionality (such as if you're running Caddy behind a http reverse proxy), you can ignore the mail message.

[–] theselfhoster@sopuli.xyz 8 points 1 year ago

Thanks for clearing my anxieties :) Sometimes I feel an irrational fear that perhaps someone has broken into my server because of my lack of security knowledge, so having that mail come in was very anxiety inducing.

[–] Tetsuo@jlai.lu 5 points 1 year ago

Yeah I think it's just a false alarm.

I would suggest looking into how sudoers works. I might just be that you asked caddy to do something that required root and forgot to sudo the command ?

Still double check the timestamp and verify that it was when you tinkered. Use "history" to look for previous commands and maybe the timestamp ?

The way I see it something (probably caddy) wanted to check a TLS certificate and had to concatenate all the certificate authorities to check if an adequate CA was there. And it failed to access what looks like a local CA that is autosigned ? Still worth checking your CA has adequate / similar permission as the others.

[–] some_guy@lemmy.sdf.org 3 points 1 year ago

If you have anything exposed, scripts and bots are testing your server all day, every day. So long as you've got proper security in place, ignore the failed attempts.