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.

Changing Root Password Problem

Discussion in 'Security' started by Leon van de Griend, Jul 20, 2017.

  1. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    VM CENTOS 7.3 cPanel & WHM 64.0 (build 33)

    I'm aware this has been discussed in other threads but couldn't find a clear answer (solution) yet.
    A few weeks ago I ordered a pre-installed Centos 7+ WHM VM
    After setting up the usual things all is up and running, and works like a charm.

    But now this: I'm trying to hardening the system to my best knowledge and want to set a strong root password.

    This seems to be an impossible task, because after a certain amount of time (5 mins) the password reverts back to the old one provided by my IP.

    1: WHM - Change Root Password works (but for around 5 mins before it reverts back to old passwd)
    2: My provider tells me that they absolutely don't prevent password changes.
    3: So i went manual mode:
    Single User Mode: Resetting/Recovering Forgotten Root User Account Password in RHEL/CentOS link: tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/
    Single User Mode: Resetting/Recovering Forgotten Root User Account Password in RHEL/CentOS 7

    All goes well but after reboot still it reverts back to old password.
    I cleared Google Chrome cache this makes no different either.

    Running out of options and no idea how this can be possible?

    Leon van de Griend
     
    #1 Leon van de Griend, Jul 20, 2017
    Last edited by a moderator: Jul 20, 2017
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,493
    Likes Received:
    31
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    You'll need to take this up with your hosting or service provider. cPanel & WHM does not revert passwords after 5 minutes. Nor does cPanel & WHM retain old copies of passwords. Something else is causing your password to revert.
     
  3. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    I have the same issue and also tried to do it via the command line with that tut. No luck too! Provider says they don't set restrictions to changing the root password.
    You're Dutch. Me too. My provider is transIP. What's yours?
     
    #3 gentlemedia, Jul 20, 2017
    Last edited: Jul 20, 2017
  4. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
  5. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Gentlemedia,

    TransIP just confirmed that this indeed is a strange issue and will contact technical support.
    They will let me know as soon as possible.

    This problem should be solved because I already spend so much time on it ;-)
    Downside with all the messing around to that I can't tell how reliable and safe the VM still is after completing so many steps without any result.
     
  6. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    I figured. Thank you for the confirmation.
    I placed this issue back at my hosting service.

    Leon van de Griend
     
  7. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    Great! I've just sent them a message telling they have to let me know too when it's resolved :)
     
  8. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator

    TransIP


    21 juli 2017 14:51

    Beste Leon,

    Het heeft even geduurd maar wij zijn een stap verder gekomen.

    Na onderzoek zijn wij erachter gekomen dat na de installatie het root password netjes aangemaakt word, maar dat het bestand die dit mogelijk maakt niet automatisch verwijderd wordt. Dat zorgt ervoor dat het wachtwoord steeds terug springt.

    Wij gaan kijken hoe wij dit op gaan lossen, maar hebben voor nu een workaround die je kan gebruiken :).

    Voor nu volg deze tutorial:

    .tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/
    ==
    tot stap "mount -o remount,rw /"
    ==

    Na die stap doe je:

    ==
    rm /etc/systemd/system/cpanelboot.service
    rm /etc/systemd/scripts/cpanelboot
    ==

    en dan de rest weer volgen zoals in de tutorial.

    Mochten er verdere vragen zijn dan horen wij dat graag!
     
  9. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    @Leon van de Griend
    Yeah, I got that message too from TransIP. Still anxious tho' to mess around too much with this through the command line. Did you do it already?
     
  10. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Don't try it, it doesn't work.
    Starting to get annoyed slightly.

    rm /etc/systemd/system/cpanelboot.service
    rm /etc/systemd/scripts/cpanelboot

    Resulting message:

    remove /etc/systemd/system/cpanelboot.service : No such file or directory
    remove /etc/systemd/scripts/cpanelboot: No such file or directory

    Again this output goes back to Trans IP

    leon
     
  11. Leon van de Griend

    Joined:
    Jul 10, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    @gentlemedia

    It seems it does work now.
    I did a complete fresh install and now it works.

    just check if these paths are correct:

    /etc/systemd/system/cpanelboot.service
    /etc/systemd/scripts/cpanelboot

    Steps:

    1: boot into single user mode
    To do this reboot the Server as soon as you get the below screen press 'e' (stands for edit) from keyboard.

    2: After you press 'e' from keyboard you would see a lot of text which may be clipped as per the size of your screen.
    Search for the text “rhgb quiet” and replace it with “init=/bin/bash” without quotes.

    3: Once done editing press 'ctrl+x' and it will start booting with specified parameter. And you will get bash prompt.

    4: Now check the status of root partition by running following command on the single user mode.
    # mount | grep root

    5: You may notice that root partition is reported to be 'ro' (Read Only). We need to have read-write permission on root partition to change the root password.
    # mount -o remount,rw /

    6: Also cross check, if the root partition is mounted with read-write permission mode.
    # mount | grep root

    7: Remove files or directories
    # rm /etc/systemd/system/cpanelboot.service
    # rm /etc/systemd/scripts/cpanelboot

    8: Set New Password
    # passwd root
    [Enter New Password]
    [Re-enter New Password]

    9: Autorelabel
    # touch /.autorelabel

    10: Reboot
    # exec /sbin/init

    Good Luck!
     
    cPanelMichael likes this.
  12. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    Thanks @Leon van de Griend ! I haven't been messing around with this yet, but good to hear you've succeeded.
    What do you mean with a fresh install? Did you reinstall CentOS and WHM/cPanel on your VPS?
     
Loading...

Share This Page