I have root access in my Linux environment. I have a directory 'officestaff'; this directory permissions were changed to 775 and the modification date changed. How can I know the previous permissions of that directory before modification?

I have tried history but it does not show any chmod on the directory.

  • 3
    Not unless you make special provisions, by storing the old permissions somewhere first, or by creating a backup or snapshot, for example.. – malyy Jun 1 '16 at 13:15
  • ok..thanks..any other possibility ? can any one help me.. – gs rao Jun 1 '16 at 13:57
  • unless you have auditing enabled on your system, there is no way to look back for the permissions or ownership of any file. Do you have auditing enabled on this system ? – MelBurslan Jun 1 '16 at 14:08
  • 2
    Backups have the previous permission. – Giacomo Catenazzi Jun 1 '16 at 14:09
  • sorry if i dont know the basic stuff , i am not aware of auditing , what is that? – gs rao Jun 2 '16 at 14:07

Past permissions of files are not recorded by default. Unless you had taken steps to set up some form of logging before the change happened (a variant of Is it possible to find out what program or script created a given file?), this information is not available. And even then logging would only tell you what changed, not what was there before.

Even if you did find the command that changed the permissions in some history, that wouldn't tell you what the previous permissions were.

Unless you had set up a way to track permission history, the only place where the historical information is available is your backups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.