Var/log/letsencrypt permission denied


#1

I can’t access my logfile anymore.

I’m root on a raspberry.
drwx------ 2 root root 4096 Mar 22 22:43 letsencrypt

What can I do?


#2

How are you trying to read the logfile? Does whoami return root?


#3

Find a group that you are a member of (I assume you are logging in as pi, if not put your username instead):
$id pi
Set that group on the folder with your logs in it:
$sudo chgrp group /var/log/letsencrypt
Give that group rights to the folder
$sudo chmod g+rwxs /var/log/letsencrypt

The s above will set the sticky bit on the folder and cause files to inherit the group.

Another option:
sudo less /var/log/letsencrypt/logfile.log


#4

I made pi owner the letsencrypt folder and I can read them now but will the former group still be able to write to the logfiles?