The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restore default ownership in CentOS

Discussion in 'General Discussion' started by sassou2009, Mar 10, 2011.

  1. sassou2009

    sassou2009 Active Member

    Joined:
    May 25, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    hi guys,

    i was trying to change the ownership of just one folder but by mistake i changed the ownership of all the server files and folders :confused:
    i used this command in ssh:

    Code:
    chown -R root:root /
    can i restore the default onwership without formatting the server ?
    please help ASAP :(
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You cannot restore the ownership easily after having done that command. You should use any backups you have and either reformat or use a new machine for the accounts. You'll spend more time trying to fix having done this command over simply reformatting or getting a new machine for the accounts.
     
  3. sassou2009

    sassou2009 Active Member

    Joined:
    May 25, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    i repaired the server myself without backup, anyway i need help on this:
    Restarting DNS Server

    Waiting for nsd to restart...............................................................finished.


    nsd has failed, please contact the sysadmin (result was "nsd is not running").
    Mar 10 20:36:18 server6 nsd[22112]: ...stale pid file from process 21843
    Mar 10 20:36:18 server6 nsd[22113]: unable to load /var/lib/nsd/nsd.db: Permission denied
    Mar 10 19:36:18 server6 nsd[22113]: unable to open the database /var/lib/nsd/nsd.db: Permission denied
    Mar 10 19:36:18 server6 nsd[22113]: server preparation failed, nsd could not be started
    Mar 10 19:36:18 server6 nsd[22113]: failed to unlink pidfile /var/run/nsd/nsd.pid: Permission denied
     
  4. sassou2009

    sassou2009 Active Member

    Joined:
    May 25, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Mar 10 19:36:18 server6 nsd[22113]: failed to unlink pidfile /var/run/nsd/nsd.pid: Permission denied
     
  5. classical

    classical Active Member

    Joined:
    Dec 16, 2010
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    you can find all root ownership files and than change it. find /path/to/dir/ -user root
     
  6. Terminat

    Terminat Member

    Joined:
    Apr 2, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Bump, i did the same mistake :/
    4yr since this post got posted, is there any fastfix for this at this moment? Right now all my clients have 500 error.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There's no simple fix other than restoring the server from any backup images you have, or manually correcting the ownership values.

    Thank you.
     
Loading...

Share This Page