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.

Change root password

Discussion in 'Security' started by biggdogg285, Jan 15, 2017.

Tags:
  1. biggdogg285

    biggdogg285 Well-Known Member

    Joined:
    May 14, 2004
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    156
    cPanel Access Level:
    Root Administrator
    I would like to change my servers root password every12 hours automatically via the crontab.
    Any ideas on how to accomplish that?

    Thank you!
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can change that with using " echo "USERNAME:NEWPASSWORD" | chpasswd " but can you please let me know why you want to change that with cron and every 12 hours ?
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,393
    Likes Received:
    52
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    It is too risky to do it like this because you will have to pass the new password somewhere to view and doing this may be a bit risk in terms of security. You may end up losing the password too. However, if you want to do something security wise, I would suggest using an SSH key and disable the password authentication, so there will be no need to have the SSH password to be changed again and again.
     
  4. biggdogg285

    biggdogg285 Well-Known Member

    Joined:
    May 14, 2004
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    156
    cPanel Access Level:
    Root Administrator
    Thanks for your responses.

    I just want to randomly change the root password so that nobody can access it via WHM.
    We do use CSF for brute force attacks, but I would feel better if that root password wasn't stored anywhere.

    SSH is already locked down to a different port and will not accept password authentication.
    PermitRootLogin without-password
    PasswordAuthentication no

    Any idea how I can cleanly update the root password via the root cron?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,979
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can find discussion and examples on this topic at the following third-party URL:

    Change Password every week for root user script

    Thank you.
     
Loading...

Share This Page