How to restore default access rights to the directory structure of linux?

Posted on 2004-10-22
Last Modified: 2012-08-13
Hi all,

Is there a possibility to restore the default access rights to the default directory structure of linux?
I mean the default owner and rights to /etc /usr and so on, that were applyed during the installation
The distro in question is debian.

Question by:meciab
    LVL 6

    Expert Comment


    short of restoring a backup or reinstalling the system I can see no way to do what you want here.
    LVL 2

    Expert Comment


    This is not possible.



    LVL 44

    Accepted Solution

    I would not say it's impossible, but it will be complicated: You need a fresh install of your system. Once you have that, you can write a Perl script that goes through the the directory hierarchy and records the ownership, group  and permissions for every single file and stores this data to a file. You take this file to your system that you want to repair and run a second Perl script that takes the information from your config file and applies the ownernship/group/permission information to all files listed in your config file. Once you are done, you can delete your temporary install of Debian again.

    You don't have to use Perl, you can use any other language that allows you to get this information from the files, stores it to a file and restores this information again (this could even be a shell script).


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Prepare to Pass the CompTIA A+ 900 Series Exam

    CompTIA aims to adapt its A+ Certification to reflect the most current knowledge and skills needed by today's IT professionals--and this year's 2016 exam is harder than ever. This certification is one of the most highly-respected and sought after in IT.

    This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now