Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting permission denied error when running cf command on mac os x

I have installed Cloud Foundry CLI package on my Mac OS X Yosemite. From the terminal interface when I type cf command, I get the following error

FAILED
Error read/writing config:  open /Users/viyer/.cf/config.json: permission denied

How do I fix this? I can't find the file config.json.

like image 907
Vish Iyer Avatar asked Feb 27 '16 11:02

Vish Iyer


People also ask

Why do I keep getting access denied Mac?

Permission denied for files, folders, or disks on Mac - The most likely reason for permission denied error when you want to open a file or folder is locked. It might be because you don't have administrator privileges or the file is created to be locked.


2 Answers

I found that removing the .cf directory then running the cf cli fixed it

sudo rm -r ~/.cf
cf -h
like image 179
broomyocymru Avatar answered Dec 29 '22 14:12

broomyocymru


That was a bit weird, but I solved it by assigning 777 permission to the folder and config.json.

So, sudo chmod 777 .cf/config.json resolved the problem in my case.

Give it a try!

Cheers!

like image 21
Dipin Krishnan Avatar answered Dec 29 '22 15:12

Dipin Krishnan