how to chmod 0777 local folders? ...Terminal?

Joined
Jan 25, 2007
Messages
18
Reaction score
0
Points
1
I know how to chmod files on a server via FTP but these are local files. I just installed WordPress and an e-commerce theme on a localhost via MAMP. However, when I activated the theme, it said I need to adjust the writing permissions to chmod 0777 of a few folders (bills, dl, uploads, and cache). I've seen a few different Terminal command lines recommended to chmod but I'm not well-versed in Terminal and I don't want to screw anything up. What do I need to do? (I'm running OS X 10.7.2) Thanks
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You can avoid the Terminal here. Right click the folders and changed the permissions for each user/group to read & write.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
It is a terminal command
Code:
chmod 777 <name of file or folder>
If you make it 777 on a file it means world read/write/execute.
If you make a folder 777 it also means world read/write but the last bit although still execute means world can go into the folder. Note the chmod command and 777 can be a very dangerous thing - giving access and execution rights to everyone usually isn't recommended.

You usually want 755 for directories and 644 for files which is owner r/w everyone else read-only - and files non-executable.

For reference here is how numbering of chmod works which is based on Octal representation of the 3 permissions fields. user, group, everyone
chmod by the Numbers
(There 000 000 010 types of people - those who understand Octal and those who don't)
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
It sure does but it doesn't do it recursively. If you need to do it recursively, click the lock in the bottom corner, make the changes, click the "gear button" and select "Apply to enclosed items."

If you want to do it the command line way, simply execute the following:
Code:
chmod -R 777 <name of folder>
Note that this does it recursively - remove the -R to apply the command to the folder only.

I'm also surprised that you were asked to use rwx permissions - that's a terrible design decision.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
I didn't mention recursive as I already feel that a 777 is dangerous. -R means everything below becomes world read/write. I highly recommend against using -R 777 unless you really, really know what you are doing and why.

Here is the top level page of the chmod tutorial I pointed to - if you want to know the gory details and all that chmod can do.
Tutorial for chmod
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I didn't mention recursive as I already feel that a 777 is dangerous. -R means everything below becomes world read/write. I highly recommend against using -R 777 unless you really, really know what you are doing and why.
Couldn't agree more. I only suggested it since changing the option only for the folder didn't seem to work. ;)

JDubya, I've worked with Wordpress and never in my life have I seen it require 777 permissions. The Wordpress site even has a page on permissions in which they discuss the dangers of 777 (see here). To quote that page:
I've never come across anything that needed more than 767, so when you see 777 ask why its necessary.
 
OP
J
Joined
Jan 25, 2007
Messages
18
Reaction score
0
Points
1
Yeah, I've read a lot about the dangers of 777 so I contacted the developer about the issue. They said one of the folders, is protected with an additional .htaccess file. However, I don't think the others are so I may see if I can also protect them via .htaccess

Is .htaccess adequate protection for 777 permissions?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
As noted on the page I linked to, 644 is the recommended set of permissions for the .htaccess file. If they are suggesting 777 for everything, they're going against Wordpress' own set of recommendations.
 
OP
J
Joined
Jan 25, 2007
Messages
18
Reaction score
0
Points
1
As noted on the page I linked to, 644 is the recommended set of permissions for the .htaccess file. If they are suggesting 777 for everything, they're going against Wordpress' own set of recommendations.

not "everything", there are 4 folders they require to be 777. One of which is protected via .htaccess. I'm wondering if I should protect them all with .htaccess, or is that not good enough
 
OP
J
Joined
Jan 25, 2007
Messages
18
Reaction score
0
Points
1
Good news, the developer said I can use 755 permissions as long as my "server communicates with PHP with CGI mode"
 
Joined
Nov 15, 2011
Messages
948
Reaction score
150
Points
43
Location
Toronto
Your Mac's Specs
MBP 16” M1max 32/1tb and bunch of other mac/apple stuff
if your on a webserver that supports suPHP, you can avoid the whole 777 danger altogether.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top