Permission denied to /etc/letsencrypt/live

So yesterday was the first time when I was trying to install nginx on my website through putty and use ssl certificate. But whenever I run this command:

sudo nginx -t

I get this error: error 02001002 which says that fullchain.pem is not in the live directory.
Then I went to WinSCP and checked that live directory exists but I can't access it because it's says that I don't have permission. I even try to change chmod to 777 still can't access it. Can;t access it even through putty console. How can I access that /etc/letsencrypt/live folder? How for my user give the permission to access it ?

I'm also disabled root login

sudo chmod 755 /etc/letsencrypt/live/

This helped.

What was the exact error message from Nginx? Since it was running as root, it shouldn’t suffer from permission-related issues.

You should change the permissions on the live directory back to what they were, e.g. with sudo chmod 700 /etc/letsencrypt/live/.

Your private keys are sensitive, and it’s not supposed to be publicly accessible.

(If the live directory is the only thing you changed, they’re not exposed yet, but still.)

Since Nginx normally starts as root, it should have no trouble accessing the files.

If you want to examine Certbot’s files, you can open a root shell, or use “sudo ls -l /etc/letsencrypt/live/” or whatever.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.