Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I mistyped my superuser. It should be "masi" instead of "maasi". I do not want to configure and install all packages again. How can I change it?

share|improve this question

migrated from Aug 9 '09 at 18:25

This question came from our site for professional and enthusiast programmers.

up vote 9 down vote accepted

If you're not talking about UID 0 (which is almost always called root, and probably hardcoded as that name in a few admin applications), then the 'super user' is just a user in the admin group. You can use the method mentioned above (though make sure you also edit /etc/shadow and /etc/gshadow, and use vipw and vigr), but I'd recommend simply creating a new account with the correct name, adding it to the admin group (adduser masi admin), and migrating your data to it (copying the home directory and chown -R masi are probably sufficient). Log in to the new account and confirm that you can run sudo before deleting the old account. This is much less likely to leave you locked out of your system.

share|improve this answer
Thanks for pointing out /etc/shadow and /etc/gshadow! – Masi Sep 28 '11 at 21:42

You will want to use the usermod command. It will update all files needed for you as well.

You must make note of the caveats though:


usermod will not allow you to change the name of a user who is logged in. You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID is being changed. You must change the owner of any crontab files manually. You must change the owner of any at jobs manually. You must make any changes involving NIS on the NIS server.

share|improve this answer

Just edit the entry in /etc/password to what you want. You may also need to update /etc/group for consistency. Then rename your home directory (in /home) to match.

All file permissions are done by user/group ID (the number associated with your name) so by updating the name, it should "just work".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .