SysSachin

Well-Known Member
Aug 23, 2015
604
49
28
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 ?
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
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.
 

biggdogg285

Well-Known Member
May 14, 2004
73
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463