Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-30-2011, 03:47 PM   #1
LQ Newbie
Registered: Jul 2005
Posts: 8

Rep: Reputation: 0
Accidently reset SELINUX context for /var folder permissions....HELP!?!?!?

Hello all,

I accidently reset the SELINUX context on the /var folder from "var_t" to user data. Now I cant go back and set it to "var_t" and i cant access my website anymore.

Any help for this newbie?


Old 01-30-2011, 04:13 PM   #2
Registered: Oct 2010
Location: Cleveland
Distribution: Slackware, Fedora, RHEL (4,5), LFS 6.7, CentOS
Posts: 258

Rep: Reputation: 29
I am not very fluent with dealing with SEcurity Contexts, but you should be able to change it back to whatever it was with


info regarding using chcon

info chcon
Old 01-30-2011, 04:16 PM   #3
Senior Member
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
Try the restorecond command
1 members found this post helpful.
Old 01-30-2011, 05:18 PM   #4
LQ Newbie
Registered: Jan 2011
Posts: 18

Rep: Reputation: 2
Since you can't see your website, you probably won't mind rebooting your server.

I would recommend the following course of action - it's fully automatic:
setenforcing 0
touch /.autorelabel
Temporarily pasify SELinux - will allow your server to work, but without SELinux protection.

From the SELinux man page: "The best way to relabel the file system is to create the flag file /.autorelabel and reboot."

I hope this gets you out of difficulty.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SElinux context for FTP smilemukul Linux - Newbie 3 09-23-2010 06:35 PM
/var/log/Xorg Permissions Reset During Re-Boot zcrxsir88 Linux - Security 1 01-28-2010 03:18 PM
SElinux context problem Bit-Devil Linux - Security 0 12-04-2009 07:58 PM
logrotate creates /var/log/messages with the wrong selinux context on RHEL5 smoyse Red Hat 3 03-30-2009 09:20 PM
invalid context in SELinux lothario Linux - Security 1 06-17-2005 05:03 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration