LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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: 260

Rep: Reputation: 37
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,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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
LQ 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: 260

Original Poster
Rep: Reputation: 37
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
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration