Forum Moderators: bakedjake

Message Too Old, No Replies

chmod - permissions

Whats is it and how do I do it?

         

limbo

4:54 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi folks

I try to avoid this side of the server as much as I can but I have the need to change permissions on a couple of system folders for a php application I am testing (hacking).

I get the following error message:

A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.

When I look up the problem the help section it says that I need to:

# Chmod the permissions of the main directory to 707.
# Chmod the permissions of the home/inc/user_settings.php file to 707.

So how do I do that then? I have no experience of servers what so ever - so I am not sure how to even access the bloody thing...

Or am I in the wrong place?

Cheers, Limbo.

jtara

7:31 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think "the right place" is a basic tutorial on Linux.

I don't see how you can expect to manage your server without some basic knowledge. You can't expect us to spoon-feed you with the basics. And this IS about as basic as you get.

Sorry if this is harsh, but I think it's the best advice I can give: go out and buy a beginner's book on Linux, or do a search and find a website that will give you a basic tutorial.

limbo

8:13 am on Jul 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am not expecting to manage the server - just change the permissions for a few folders so I can use some off the shelf application. Didn't think it was that stupid a question fom someone who pushes pixels :)

As it turns out it is very easy - but to the uninitiated the thought of making server changes is pretty intimidating.

"Using FTP right click the folder (remote) and set the permissions to the requested value"

(doesn't work in Dreamweaver)

lammert

12:32 pm on Jul 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



chmod 707 on files makes my always scary.

I am a long time unix user and I always use the built in security features in this operating system to add extra security for my sites. One security measure is that all my static files (.html, .php etc) are owned by one user, and the webserver is running as another. Only when I need to change a configuration via the web interface, I temporarily use a chmod to let the webserver user access those static files, but afterwards I remove the write privilege immediately. The webserver can read all static files, which is enough for 99.5% of my applications.

In this configuration, even when an intruder manages to exploit a bug in the webserver, PHP script etc, it cannot easily replace the existing website with other pages.

chmod 707 is a work-around, but not a long term solution for any problem with a public computer system like a web server.

wheel

4:44 am on Jul 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At the command line just type in 'chmod -R 707 directoryname'. That's how to accomplish what you want. As noted above, what you want though, may not be a real good idea.

Very basically, the three individual digits in the chmod command refer to different users. THe first digit (a 7) refers to the owner of the file - likely you. The second digit refers to other users in the same group as you and is really a server thing - it's likely not anybody else. The third digit refers to 'everyone else'.

The numbers themselves are basically a binary representation of "read" 'write' and 'execute'. In other words, a 7 is 111 - or all of read, write and execute permissions. If you just wanted to give someone read permission, that's 100 in binary, or a 4. read/execute is 101 or a 5 which is why you frequently see 755 for program files in your cgi-bin - you need to give execute permissions to files in cgi bin.

Now if you review that, you'll notice the last 7 in the 707 is giving all permissions (read/write/execute) to anyone. That's what doesn't seem like such a good idea.