skip to Main Content

I can’t cd into on my ubuntu machine, I can see the contents of the folderwith

/etc/letsencrypt/live

but I get "Permission denied" when I try to cd into it.

My user has sudo powers so why can’t I access the folder?

These are the live folder permsissions just in case

https://i.imgur.com/Ks10LEK.png

2

Answers


  1. Despite having sudo privileges, only the root user can view that directory since the owner is root with perms 700. You’ll need to escalate privileges with sudo su to become the root user. Then you can cd into the directory.

    Login or Signup to reply.
  2. Your folder permission is set only for root user. There is a way to modify the permission of a file/ folder as we required. But "BE CAREFUL" when modifying permissions, as modifying permissions of some root file/ folder can cause problems. (eg: /usr)

    But if your file/ folder could be used by any user with full permission (read, write & execute), you could just use below line to modify its permission and continue to work on it. So there would be no more "Permission Denied" problems.

    • File :
    sudo chmod a+rwx filename
    
    • Folder :
    sudo chmod -R a+rwx foldername
    

    Here you can find further details on modifying permissions using chmod. So you could modify according to your requirement.
    https://www.howtogeek.com/437958/how-to-use-the-chmod-command-on-linux/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search