Find the answer to your Linux question:
Results 1 to 2 of 2
hi out there we have a customer that ran a sudo chmod +x -R * command on his / filesystem by mistake and now the machine cannot be accessed on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5

    chmod issue


    hi out there
    we have a customer that ran a sudo chmod +x -R * command on his / filesystem by mistake and now the machine cannot be accessed on the network

    Has anyone any idea what chmod command to run to restore the system to its original state ?

    thanks
    P

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,422
    This cannot be easily reverted.

    Once you gain access to the box either locally or via remote management,
    your options are:

    a) Make a list of all files and permissions of a comparable system (same distribution, same version, etc)
    and apply those on the borked machine
    b) look at the changes via a previously installed file integrity scanner like aide, apply like in a)
    c) restore the system directorys from backup
    d) maybe rpm still works.
    Code:
    rpm -Va
    This command will list all modified packages/files.
    Reinstall these packages via rpm (or yum, if it still works)
    e) reinstall

    Personally, I would go for e), as my machines are fully automated, config controlled and redundant.
    If that is not the case, try d)

    Edit:
    Seems a little more is needed to get to the list of packages:
    Code:
    rpm -Va --nodeps --noscripts --nodigest --nosignature --nolinkto --nomd5 --nosize --nouser --nogroup --nomtime --nordev | sed -n 's/.*M.* \(.*\)/\1/p' |xargs rpm -qf --queryformat "%{NAME}\n" | sort | uniq
    Last edited by Irithori; 06-15-2011 at 06:39 PM.
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •