Technorati Tag - Computer Security
By K1u
http://k0h.org
Commonly asked. -
What are CHMOD's?
To break it down basically they are rules or permissions. It stands for CHange MODe.
How can I edit them?
Use a FTP client to connect to your server, I suggest Filezilla. Other popular method through SSH.
If they are configured badly can I get hacked?
Short answer No. Long answer... lets put it like this, if you have something CHMODDED to 777, yes it is writable to the public... but they must gain access to your server to be able to write in any of these files. But... I am not saying to go out and CHMOD your whole root directory to 777... no not at all, yes you can get hacked... though this is with result of the groups not being configured properly.
Well then whats the best CHMOD?
755.
Now for the information. -
So let me first explain what the 3 places on a CHMOD are with a diagram.

Now to explain what these numbers can mean. Before I do that I will point out another way you might see CHMOD's formatted, particularly on Unix based systems when looking at file permissions.
R - Read
W - Write
X - Execute
0
= No permissions at all. (
---
) - Avoid this.
1
= Only permission to execute. (
--x
)
2
= Only permission to write. (
-w-
) - Avoid this.
3
= Permissions to write and execute. (
-wx
)
4
= Permission to read only. (
r--
)
5
= Permissions to read and execute. (
r-x
) Good.
6
= Permissions to read and write. (
rw-
)
7
= Permissions to do anything. (
rwx
)
Examples. -
Bad -
777
(
-rwxrwxrwx)
= Anyone can Read, Write, and Execute.
Good -
755
(
-rwxr-xr-x)
= You can do Read, Write, and Execute. Others can only Read and Execute.
Bad situations. -
I CHMODDED myself so I have no permissions to the file, what the heck do I do?!?
Ouchies! First off why did you do that? Find a backup of the file or try to download it to your system and chmod it as root.
My Web server has been attacked and my host blames my CHMOD's!
Blame your host for not setting up the groups correctly!
More questions! -
How do I change CHMOD's on my computer?
Simply -
chmod value filename
Example -
chmod 755 priv.txt
I want to change who is the owner of the file?
Use the chown command.
Syntax -
chown [-hHLPR] [[user]] [:group] target1 [[target2 ..]]
I want to change the group(s) of the file?
Use the chgrp command.
Syntax -
chgrp group target1 [target2 ..]
I am using windows what am I supposed to do?
Cacls.exe (Change Access Control Lists)
Links! -
CHMODDING on FreeBSD - http://www.freebsd.org/cgi/man.cgi?query=chmod&sektion=1
CHMODDING on Mac OS X - http://www.hmug.org/man/1/chmod.php
CHMODDING on Solaris - http://docs.sun.com/app/docs/doc/817-0689/...hmod&a=view
CHMODDING on Linux - Already shown in tutorial.
http://k0h.org <-- Hacking, Programming, Security community.
|