| Guidance
This article provides solutions to the following:
- [errno 13] permission denied: ‘/var/log/letsencrypt/.certbot.lock
- [errno 13] permission denied: ‘/etc/letsencrypt/.certbot.lock
- either run as root, or set –config-dir, –work-dir, and –logs-dir to writeable paths
| Situation
I set up a linux command in crontab to renew the https certificate.
However, the command didn’t work as a permission issue.

| Solution
- Change the ownership of the certbot directory or file on Linux.
- Change the permissions of the certbot directory or file on Linux.
| 1. /var/log/letsencrypt
cd /var/log
sudo chmod -R 775 letsencrypt/
sudo chgrp -R ubuntu letsencrypt/
ll | grep letsencrypt/



| 2. /var/lib/letsencrypt
cd /var/lib
sudo chmod -R 775 letsencrypt/
sudo chgrp -R ubuntu letsencrypt/
ll | grep letsencrypt/
| 3. /etc/letsencrypt
cd /etc
sudo chmod -R 775 letsencrypt/
sudo chgrp -R ubuntu letsencrypt/
ll | grep letsencrypt/
| 4. Confirmation
certbot renew --dry-run

You can now verify that the certificate renewal works well with your user rights.
good!!!