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.

Recover root user?

Discussion in 'General Discussion' started by 0senjed0, May 28, 2016.

  1. 0senjed0

    0senjed0 Registered

    Joined:
    Aug 21, 2010
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    i was wrongly run command
    # chsh -s /usr/local/cpanel/bin/jailshell ${username}
    and now my root user gives me error

    '0' is not a valid user id, and may not run jailshell (cpanel users file missing).


    how can i recover my root user ?
     
  2. gryzli

    gryzli Active Member

    Joined:
    Jul 23, 2012
    Messages:
    44
    Likes Received:
    5
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Twitter:
    I firstly thought about su, but it seems to spawns the root shell also.

    If you have sudo and sudoers, this could save you.

    If not the rescue cd or (mounting the root partition externally if this is VPS) seems to be the solution for this.
     
  3. 0senjed0

    0senjed0 Registered

    Joined:
    Aug 21, 2010
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    This centos dedicated server . does it possible to recover it with KVM Access ? i'm so amature on this issue
     
  4. gryzli

    gryzli Active Member

    Joined:
    Jul 23, 2012
    Messages:
    44
    Likes Received:
    5
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Twitter:
    You must be able to boot some rescue cd (centos has this) through KVM,

    After booting the rescue, you should mount your system partition and be able to directly edit /etc/passwd in order to fix the shell.

    In fact, if you choose centos rescue to try automatically find your partitions and mount them for you, there is a pretty big chance, the system will handle this and you will have ready mounts (so only the edit of passwd must be made). If the rescue mounts your partitions, they usually reside into: "/mnt/sysimage"

    This video must be close enough to your steps in order to get into rescue mode:
    youtube.com/watch?v=I46_BHe9N6o

    The only prereqiusity is to find Centos 6.x ISO , mount it through KVM and boot from it.
    You can get the ISO from some Centos mirror, which will look something like this:
    http : //mirror.some_close_to_you_mirror.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-netinstall.iso

    Where "mirror.some_close_to_you_mirror.com" is one of the list here:
    Mirror List

    Hope this helps.
     
    #4 gryzli, May 29, 2016
    Last edited by a moderator: May 29, 2016
  5. tank

    tank Well-Known Member

    Joined:
    Apr 12, 2011
    Messages:
    236
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Do you have ConfigServer Explorer - cse installed on your server. Maybe you can run a command through there.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,466
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Assuming your server is with a Hosting Provider, you should contact them for assistance with this. They're the only ones that can help I think.
     
Loading...

Share This Page