I would be shocked if you needed to use this command any time soon! I did however need it almost right away. This is something that only experienced linux people should be playing with, as you can screw the file from being able to function properly depending on the type of file it is. Don't worry though, you can always change it back, or to something else. First, let's talk about what the hell you even need (or do not need -for some people) this command for...
As i mentioned briefly in the very beginning of this whole tutorial, SELinux is a very inginuitive implimentation of security policies, which is far superior to any security that windows will ever have. The plain truth about SELinux is that sometimes -for some people- it's just TOO damned secure, and it sometimes makes it harder for you to set things up, such as file sharing (EX: workgroups), and other tasks. Many people completely DISABLE SELinux alltogether. For most users, including you, this is completely safe to do. Why? Because linux is pretty much immune to all viruses. I won't explain in detail as to why, but i'll give a quick explanation in the way that i understand it. About 99% of all viruses are written to attack windows, which means that they can't do anything on a linux computer but just sit there and -well... do nothing! That's because they were written for the windows API, which obviously linux doesn't have -duh. Another reason is that the few viruses that were written for linux are outdated as soon as they're written half the time, because linux has new updates almost every day for different parts of it's core, including the linux kernel itself.
For a simple explanation of how SELinux works, i'll say this: You are logged onto your OS and running whatever applications you choose, and for some reason - somehow - one of your programs gets hacked (almost impossible with linux, but we'll say it does, for argument's sake), and the hacked code is supposed to destroy all your data. Well, it gets stopped dead in it's tracks, because SELinux knows what things that program is allowed to do, and will not allow it do to anything else, even if you're logged in as an administrator (root). These permissions are dictated by the SELinux 'context' that the program is categorized under, which can only be changed by an experienced computer administrator.
To disable SELinux, on the menu (Gnome, don't know where it is for KDE) click 'System > Administration > SELinux Management'. Under the SELinux dropdown menu, select the 'Disabled' option. Click ok, and close it. You can skip to the next lesson now, unless you want to read just for fun...
First, before changing the SELinux Context of a file, you need to know what you're changing it TO. Here, i'm going to be of no use to you... But i can tell you how to find out! Ok, the only scenario that i have EVER had to use this under, is to change the context of some of my files in my /var/www/html directory, where Apache keeps your web content.
For some reason, any file that i did not create and save IN that directory -meaning files that i created or had stored elsewhere, and moved to that directory- Apache could not access them. This had me beating my head against a wall, and no one else knew what it was, but they (some of the people at fedoraforums.org) thought that it had something to do with permissions. Well i knew that much, but i had already did a 'chmod 777 -R' on them, so that was kinda -well... agrevating!
Finally, i noticed that the SELinux context of the files that were not being accessed by Apache was different from the files that WERE being accessed. The one's that were NOT being accessed had a context of 'user_t' or something like that, but they needed to have a context of 'user_u:object_r:httpd_sys_content_t'. How did i find this out? With this command (the '-Z' option tells the 'ls' command that i want to see the SELinux content of the directory/file specified. The 'ls' command simply lists stuff in a directory):
ls -Z /var/www/html"Alright, so how do i CHANGE the context?". With this command (the '-R' flag means recursive, and the 'c' flag means that you want it you tell you about everything that it CHANGES, so things that it didn't alter will not be listed):
chcon user_u:object_r:httpd_sys_content_t /var/www/html -RcUPDATE: After recently having to use this command, it was requiring a different syntax, and failing for the original. The new syntax (that works for me) is as follows (i will try to elaborate on this more later):
chcon -Rv -usystem_u -robject_r -thttpd_sys_content_t /var/www/html