Change root username in Linux

Diaa - Updated on Nov 30, 2018 at 10:02 AM
 mpo - Apr 17, 2018 at 09:24 AM
Hi all
My question is:
Is there a way to change the user account name as a way for more security.
(i.e, I am a root on RedHat system and want to change my username <root> to another name say <diaa>)
Is that possible.
Waiting for a response!

9 replies

I can only advice not to change the root username. It can get you into many troubles if you don't know EXACTLY what you are doing.

The fact that you are asking the question on how to do it means you don't.
  • For one it will pretty much invalidate your crontab and vital scheduled system functions won't get executed.
  • Many other config files explicitly mention 'root' let alone some scripts will have hardcoded references to 'root'.

Yes all the other answers in this thread are correct. You CAN do it. But I advice you not to unless (I am repeating myself).
Thanks for the advice i don't change it
thank you