Root password change in WHM has no effect in cmd-line login

gentlemedia

Member
Jul 15, 2017
11
1
3
Greece
cPanel Access Level
Root Administrator
Hi,

I have a rather strange issue.
I've changed my root password in WHM, because I still used the password that my provider created when I purchased my VPS.
I can login with my new password in WHM, but as I want to login with su root in the cmd-line with my new root password, I get the message su: Authentication failure.

Now here's the weird thing, I can login as su root with my old root password (the one that I got from my provider).

Do I also need to change the old root password with the new one in CentOS 7 which is the OS on the server too?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
46
28
India
cPanel Access Level
Root Administrator
Twitter
Hello,

Might be there is browser cache issue or password not changed yet.

Try to access WHM after clearing browser cache. If still facing same problem then change password again.
Log into WHM >> Home >> Server Configuration >> Change Root Password
  1. Enter your new root password (twice) and select "Change Password."
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
Spain
cPanel Access Level
Root Administrator
I don't know if this is going to help......

  • I am told that some virtual servers don't allow root password changes - if you are on a virtual server - you may want to consult with your server provider.
  • Examine your /etc/passwd and /etc/shadow for duplicated root entries - I believe that there should only be one root entry in each file - if you have more, that may be causing your issue, but I don't want to advise you on how to fix it o_O
  • Check to see that any SElinux features have not inadvertently been re-enabled - I believe that SElinux is fundamentally incompatible with cPanel, although some tech sites do claim that it can be re-enabled after WHM/cPanel has been installed.

This explanation of the Understanding /etc/shadow file might be useful

Hope something helps :)
 
Last edited:

gentlemedia

Member
Jul 15, 2017
11
1
3
Greece
cPanel Access Level
Root Administrator
Thanks, rpvw.

I will ask the provider re your first point, but I'm almost certain this is not the case. I remember they even said at one point that I could/should change the root password.
Re your second point, how do I access these paths... sorry, but working with cmd-line is not something that I do often.
Re SElinus this I had to disable already according to the server requirements the CS-Cart CMS recommends me, so that's done. I'm configuring the VPS for the CS-Cart Multi-vendor software

EDIT: Sorry, I see the link now you've posted about /etc/shadow
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
Spain
cPanel Access Level
Root Administrator
I don't know if any of the following might be relevant or helpful, but I found it on the transIP provider FAQ (which is who you indicated that you have your VM with)
Frequently Asked Questions
I want to reset my root password

If you unexpectedly lost your VPS root password and your VPS uses GRUB (virtually all Linux distributions do this), you can create a new root password using the steps below.

  1. Open the console (' BladeVPS ') in the control panel and restart the VPS using the ' Reset ' button.
  2. Keep the console open and immediately after the restart, a message appears to press any key (such as ESC ) to open the GRUB menu. Pay attention! This menu is visible for up to 2 seconds, and you will have to press a number of times to prevent the OS from being booted.
  3. Select the kernel (top is the last kernel and probably the one you use).
  4. Press " a ".
  5. Now type behind the line (space) single and press ENTER.
  6. The OS is now launched in single-user mode as root.
  7. Type passwd here, press enter and enter your new root password followed by an ENTER (twice).
  8. Reboot the OS and then you will need to login with the new password.

Important information!
  • Ubuntu users: For Ubuntu, the actions are just something else; Detailed actions for this can be found on howtogeek.com/howto/linux/reset-your-forgotten-ubuntu-password-in-2-minutes-or-less/ Howtogeek .
  • Unfortunately for Ubuntu , the boot cycle is so fast that you sometimes miss the GRUB menu. You can optionally extend the time that the GRUB menu is visible by increasing the value of GRUB_TIMEOUT = x in / etc / default / grub . This can, for example, also be via the rescue mode. Via sudo update grub you can save the changes.
  • CentOS 7 users: In all derivatives of Red Hat Enterprise 7, including CentOS 7, single-user / rescue mode always requires the root password. As a consequence, the above steps will no longer work. There is another way to reset the root password, however, it is a bit more complex. You can find the steps on tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/
    tecmint .
And for Centos7 VMs

Single User Mode: Reset / Recovering Forgotten Root User Account Password in RHEL / CentOS 7
Hope this helps :) (The whole thing seems unnecessarily over-complicated to me - I am so happy I don't run any virtual servers)
 
Last edited: