LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-22-2008, 01:01 AM   #1
RMLinux
Member
 
Registered: Jul 2006
Posts: 224

Rep: Reputation: 31
How to restore default Ownership for every folder in Linux.


Hi keen folks!


In file I use restorecon -v -R permission.

how about ownership?

is it included with restorecon command?

thank you.

Last edited by RMLinux; 11-22-2008 at 01:13 AM.
 
Old 11-22-2008, 02:45 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
No, restorecon is part of SELinux, which is very much seperate from standard filesystem attributes. here a set of files detail contexts for SELinux based on regular expressions of files and similar details. no such equivalent for files in general, where the data is not managed in the same way. you can possibly reinstall certain RPM's etc.
 
Old 11-22-2008, 02:50 AM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
It would make more sense to explain why you are trying to do this, and explain what you did to cause any problem.

You may be in for a reinstall if you made a big mistake.
 
Old 11-26-2008, 02:10 AM   #4
RMLinux
Member
 
Registered: Jul 2006
Posts: 224

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by billymayday View Post
It would make more sense to explain why you are trying to do this, and explain what you did to cause any problem.

You may be in for a reinstall if you made a big mistake.
actually I did a mistake.

I change my /var chmod -R 777 and chown root:root now many problem arise.

Is there any command to restore the original permission and ownership?

What I did I copied on my old linux but I am using RHEL4 and i try to copy permission and ownership in linux RHEL3.

HOW STUPID I AM!!! I KNOW THAT AM NEWBIE ON LINUX THAT'S WHY...

so anybody please help me to restore the original permission and ownership of /var

thank you...
 
Old 11-26-2008, 02:25 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You could try something like:
rpm -qVf /var/cache/cron
to detect which directories and files have bad permissions based on the rpm database.

Then with the package name:
rpm -qlv <package-name>
to list the contents of the package including the owner.group.
 
  


Reply


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
Is there a command that gives you ownership of a folder and all it's sub-folders royeo Linux - Newbie 3 06-01-2007 01:55 PM
How do I restore the default graphics card driver that came with Fedora Linux? TippyToes Linux - Games 2 01-30-2004 10:22 AM


All times are GMT -5. The time now is 06:35 PM.

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