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.

Point my cPanel to another directory

Discussion in 'General Discussion' started by bromero, May 9, 2013.

  1. bromero

    bromero Registered

    May 9, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Website Owner
    By (a horrible) mistake, I deleted via ssh the account user that managed my only account/domain. I quickly re-created a new user with the same name, password and home. However, when I log in cPanel I land in an empty account. How can I fix this mess? The original directory is intact and I need to be able to access it again via cpanel.

  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Feb 25, 2010
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can try using the usermod command to change the home directory of the user back to the original home directory.

    Linux usermod command - Edit or modify Linux user account information | Linux basic configurations

    The problem that you are going to have is that the UID of the old user is probably different from the UID of the new user you created, and you are going to need to change the ownerships of all the files in the home directory because, right now, they are probably owned by a UID that is no longer associated with a user (since you deleted the old user).

    Do you have a good backup of the account? If you do, terminating the account and restoring it from a good backup that was made before you made this mistake is really the best way to approach this.

Share This Page