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.

chmod -R user / how screwed am i?

Discussion in 'General Discussion' started by webwizardma, Feb 25, 2014.

  1. webwizardma

    webwizardma Member

    Joined:
    Feb 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I accidentally ran this command AS ROOT...

    /chmod -R user /

    instead of

    /chmod -R user ./

    My hosting provider said they will setup new HDD's, and attach the old ones via USB for me to copy everything from, but the ETA for that is 5 hours.

    I'm a proficient coder, so anything that you can think of I can try, any ideas for a way to get this fixed otherwise?

    SSH is down, restart fails. autofixer fails. MySQL server is down. FTP, WHM/cPanel is still up.
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    lol.


    I wouldn't even try to fix it at this point. If you have another server to compare to, you can try to match the ownership on the various folders, but you'll likely have left some things broken. It'll be quicker just to get set up on a new server tbh.
     
  3. robb3369

    robb3369 Well-Known Member

    Joined:
    Mar 1, 2008
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    We recently had a similar issue, but down the user home path... Try this script:
    Code:
    #!/bin/bash
    cd /var/cpanel/users
    for user in *
    do
    	chown -R $user.$user /home/$user/
    	chown $user.nobody /home/$user/public_html
    	chown $user.mail /home/$user/etc
    done
    /scripts/chownpublichtmls
    /scripts/mailperm
    
    Again, this is specific to the home directory path, but should help a bit when moving files to new drive...
     
  4. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    To get mysql to start, you should just be able to chown -R mysql:mysql /var/lib/mysql
     
  5. webwizardma

    webwizardma Member

    Joined:
    Feb 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    No SSH. it's down :(
     
  6. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Well, if you can't SSH into the server to fix anything, you're sorta screwed. You can try going into WHM (since you said that works) and forcing a cPanel update which will trigger a series of autofixers, but the issues on the system will likely halt the update process.
     
  7. webwizardma

    webwizardma Member

    Joined:
    Feb 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I did actually try that, and I also tried rebuilding Apache via EasyApache, thinking that a rebuilt would reset permissions. None of that worked. :(

    I'm honestly surprised & confused why EasyApache didn't solve the problem!
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    This is the best option in my opinion. Install cPanel on the new hard drive, and then re-create the accounts. Ideally, you should restore the accounts from any cPanel backup archives.

    Thank you.
     
  9. robb3369

    robb3369 Well-Known Member

    Joined:
    Mar 1, 2008
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Although probably too late now, but Chirpy has a tool called CSE that gives you an virtual console into the server:
    ConfigServer Explorer

    Might be good to have in the future... This is one of the those "I'll never do that again" things. During interview prospects, I always ask the candidates what their best INDTA moments were, since I don't want them do it with my machines.
     
  10. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider

    Not sure how he would be able to do that without SSH access ;)
     
Loading...

Share This Page