Search code examples
macosterminalpermission-deniedcd

cd: permission denied: Downloads on Mac OS terminal


I was trying to connect to an EC2 instance on AWS using chmod and ssh and some how lost permission to cd into my Downloads

Apparently must have messed something up while attempting to do it since it is my first time. I forgot to cd into the location of my Key and instead and tried a bunch of things that did not work including

chmod 400 /Users/chistopherholder/Downloads 

and

chmod 400 /Users/chistopherholder/Downloads/Key-name.pem

when I realized I needed to cd into the location (by looking air a different tutorial on YouTube) I tried and con the permission denied.

How do I revert what I have done? So that I can cd into Downloads like before.


Solution

  • There is a way to reset the permissions on a Mac terminal with by running

    diskutil resetUserPermissions / `id -u`
    

    This worked for me and allowed me to cd back into the Download file