all works fine, also the renewal of the certs, but every time the cronjob run to check the certs I get this error message:
/etc/cron.daily/letscencrypt:
/opt/letsencrypt/certbot-auto has insecure permissions!
To learn how to fix them, visit Certbot-auto deployment best practices
The command, which is executed:
/opt/letsencrypt/certbot-auto renew --quiet --post-hook "systemctl reload apache2"
I checked the permission:
$ ls -la /opt/letsencrypt/certbot-auto
-rwxr-xr-x 1 root root 68699 Nov 7 00:07 /opt/letsencrypt/certbot-auto
It looks fine. Or not? What is the error?
The version of certbot-auto:
$ /opt/letsencrypt/certbot-auto --version
Requesting to rerun /opt/letsencrypt/certbot-auto with root privileges...
/opt/letsencrypt/certbot-auto has insecure permissions!
To learn how to fix them, visit Certbot-auto deployment best practices
certbot 0.40.1
Cron scripts from the /etc/cron.<timeinterval>/ will run as root. Also, the error you're focussing on wasn't in the first error presented by @istler and is probably totally not relevant for this thread.
Make sure that the directory path containing certbot-auto (which includes every directory accessed in the absolute path to certbot-auto ) doesn’t allow writing for low privileged users.
When the folder /opt has write access to everyone, an the folder /opt/letsencrypt has only write access to root, than only root can change the privilege from the folder letsencrypt, not erveryone. But everyone can create a new folder / file in the folder /opt.
In the opt folder (optional) war normaly other optional software, which own other user. Normaly no process / appliaction should run as root.