Point my cPanel to another directory

bromero

Registered
May 9, 2013
1
0
1
cPanel Access Level
Website Owner
Hello,
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.

Thanks!!!
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
27
143
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.