Can't access /etc/letsencrypt/live/mydomain in macOs

So I got this:

  • Congratulations! Your certificate and chain have been saved at
    /etc/letsencrypt/live/mydomain/fullchain.pem.

But I can't reach this directory in macOS to copy the certificates. Even if I do:
sudo cd /etc/letsencrypt/live/mydomain does not work.

I know I can sudo chown -R $(whoami) /etc/letsencrypt
but maybe there is a reason Let'sEncrypt did not gave access to $(whoami) and I am afraid of changing that without knowing the implications.

It seems a basic unix question, but I am stuck on that.

Can you change to the higher levels ? /etc ? then “ls -l” to see the files there ? if so does letsencrypt exist ? … how far can you get ?

alternatively, what if you do a “sudo su” and then once you are at the prompt try changing folderss …

Yes, I can.
sudo su is what I was looking for. Thanks.

By the way, the reason this does not work is that cd is a shell builtin command (it's part of your shell, not a separate external command). "What directory you're in" (current working directory) is an attribute of a particular running process and so it can only be changed by an internal functionality, not by running a separate program. However, an already-running program cannot increase its privileges and sudo can only grant root (or other) permissions to a newly-run program.

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