Don't have permission for .ssh folder and the keys inside, despite being owned by me
9,965
To access a folder like you want to access it you need the permission x
(execute) for the directory.
So if you change the premissions with
chmod u+x .ssh
it should be possible to access your folder.
You can only change into a folder when you have the appropriate execute permission for it.
Related videos on Youtube
Author by
galexite
Updated on September 18, 2022Comments
-
galexite over 1 year
On my Mac, I can't use git (and consequently Heroku) because of incorrect file permissions. The root user can access them fine, but my user cannot, despite me owning it and it being in my home directory.
$ ls -al
shows that I own the file and only have read and write permissions:
drw------- 7 george staff 238 27 Aug 16:53 .ssh
whilst having no ACLs.
However:
$ chmod -R 0600 /Users/george/.ssh chmod: /Users/george/.ssh/github_rsa: Permission denied chmod: /Users/george/.ssh/github_rsa.pub: Permission denied chmod: /Users/george/.ssh/id_rsa: Permission denied chmod: /Users/george/.ssh/id_rsa.pub: Permission denied chmod: /Users/george/.ssh/known_hosts: Permission denied chmod: /Users/george/.ssh: Permission denied
I've tried every thing I could think of,
chown
,chmod
andchmod -N
(to remove any ACLs). But I still can't read or write them and nor can git.Any solutions welcomed!
-
galexite over 9 yearsThanks for the quick reply, but I still cannot access the directory nor change permissions on it.
-
wurtel over 9 yearsDo "chmod 700 /Users/george/.ssh" first. If that is not allowed then something's going on with ACLs or such.
-
wurtel over 9 yearsThe "chmod -R 0600 /Users/george/.ssh" caused the execute permission to be removed from the directory, meaning you can't access the files in that directory (you can still read the directory to see its contents).