[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • Last Modified:

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

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.

Thanks.
0
meciab
Asked:
meciab
1 Solution
 
de2ZotjesCommented:
NO.

short of restoring a backup or reinstalling the system I can see no way to do what you want here.
0
 
hoonexpertCommented:
No

This is not possible.

Regards,

Manish.
Baroda.
India.


0
 
Karl Heinz KremerCommented:
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).

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now