This question already has an answer here:

how're you doing? I am somewhat new to ubuntu and finding problem changing the root user name. My terminal displays priyank@Alex right now. I changed the second name to Alex using hostname and hosts. What I want is to make it Alex@Alex. Can anyone temme how can I do it?

marked as duplicate by Pilot6, Eric Carvalho, Ravan, A.B., Marcel Stimberg Nov 4 '15 at 11:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is a duplicate, the system should automatically include that in a reply. It's a little complicated but not too bad. Follow the example in the highest rated answer and if you have trouble with that then ask a specific question and we'll help you out from there. – KGIII Nov 3 '15 at 6:26

just two steps:

1.edit the /etc/passwd file ,replace priyank to Alex ,then save

2.edit the /etc/shadow file ,replace priyank to Alex,then save

reboot and enjoy it


Use usermod command ideally - -l is the option you're after in this particular case. If you want also your home dir renamed accordingly - options -d and -m may be of your interest.

Not the answer you're looking for? Browse other questions tagged or ask your own question.