How To: Security Permissions Chmod

 

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.

 


GSO
Written on Saturday, 03 October 2009 22:18 by GSO

Viewed 410 times so far.
Like this? Tweet it to your followers!

Rate this article

Latest articles from GSO

Latest 'tweets' from GovernmentSecurity

  • News Update: Cyber war is coming, the impact could be huge: CBS News reports that cyber.. http://bit.ly/1tx1kr | #Security Link Monday, 09 November 2009 07:35
  • News Update: Tenable Network #Security Podcast - Episode 11: Welcome to the Tenable Netw.. http://bit.ly/2Iqd6G | Security Link Monday, 09 November 2009 07:35
  • News Update: Consent will be required for cookies in Europe: EDITORIAL: A law that dema.. http://bit.ly/3JYgip | #Security Link Monday, 09 November 2009 07:35
  • News Update: CBS 60 Minutes tackles cyber-terrorism: Could hackers get into the compute.. http://bit.ly/2d5Y21 | #Security Link Monday, 09 November 2009 07:35
  • Blog Update: We have launched the new GovernmentSecurity.org: We decided to launch th.. http://bit.ly/2G1SSF | #Security Link Saturday, 07 November 2009 17:38
blog comments powered by Disqus

Site Search

Disqus Tools