777 Permissions in "/files" : Folders Other Than Numbered Ones

Permalink
I'm trying to fix the "upload multiple" problem, so I'm changing "public_html/files" (and everything below it) from 755 to 777.


Question: do I necessarily want/need to have the NON-numbered folders (and one file), residing in "/files" to be 777 as well?

The folders and file are: avatars, backups, cache, dbbackups, incoming, security_wall, thumbnails, tmp, trash, and index.html.

I'm new to this, and I ask since giving the "World" permission to write and execute, etc sounds like a...bold...step.

Thanks!
Nick

 
TechBlessings replied on at Permalink Reply
TechBlessings
Be very careful with 777! This is how websites get hacked! If you need to temporarily set the permissions to 777, I suggest that you take a backup of the permissions first so that you can restore them later.

To backup the permissions, use the getfacl tool. So for example, if your Concrete5 installation is in a folder called Concrete5, simply enter this command:

getfacl -R Concrete5 > permissions.acl


This will recursively (that's what the -R does) back up all of the files in the Concrete5 folder and store them in a file called permissions.acl.

Now you can mess with the permissions all you want and not be concerned about not getting them back to the proper form.

To restore your permissions, use this command:

setfacl --restore=permissions.acl


This will reset all of the permissions back to where they were when you backed them up.

I hope that this is helpful!

Jason
rusko replied on at Permalink Reply
Lordy, Jason--thanks. I thought it seemed too open!

I'm going to undo the change now. Why are there all these posts saying to switch to 777, then? The posts I've seen haven't mentioned "temporary" or "switch em back quick". How come?

I used Cyberduck to 777-them. Can I use your 2nd command to change them back--using a different app? (Cyberduck took forever to change them the 1st time.)

cheers,
Nick
rusko replied on at Permalink Reply
Jason--

BTW, was 755 ok to begin with for "/files" (and below), or 744, or 754?

Also: would I enter the getfacl things on the "send command" line of Cyberduck?

Thanks,
Nick
rusko replied on at Permalink Reply
I'm a bit too novice for command-line Mac stuff, so I tried to undo the Permissions changes in Cyberduck (again), and it crashed after hours of claiming to be re-changing Permissions in "/files/..." on my server.

Methinks it didn't do them all: I think I created some permissions glitches since Descriptions won't stick to my uploaded images after I type the Descriptions in the upload window.

Must dig...

Nick
TechBlessings replied on at Permalink Reply
TechBlessings
One of the biggest reasons that you see a lot of "set files to 777" posts is because when you do that, you eliminate file permissions as a potential cause of the problem. Development teams and security teams will often go head to head with each other. Development believes that security is restricting their abilities and creativity. Security believes that development writes code that requires security holes to run properly.

Reality is somewhere in the middle.

Typically, these do not create a problem until you are hacked. By that time, it is too late.

File security and file backups are approached very similarly. Nobody really cares until it is too late and then they wish they had.

Jason
TechBlessings replied on at Permalink Reply
TechBlessings
I'm not very familiar with Cyberduck. I will look at it ans see what I can discover.

Jason
TechBlessings replied on at Permalink Reply
TechBlessings
I'm running on a Windows machine and my version of Cyberduck does not have the ability to send a command.

What I typically do is connect in using SSH and I can do all of my work from there.

As for reverting the permissions back, unless you use the getfacl command first, you are out of luck!

When it comes to speed, I find that the GUI tools are always slow. Using getfacl and setfacl, I can backup and restore permissions in literally seconds!

Jason