How To Change or Rename Username and User ID In Linux?


The problem is we want to change the allready created user name or user id. As we know there is a lot of configuration those rely on the user id like permissions. We will use usermod command to make this change. Keep in mind this changes will effects system wide.

List User Info

Before starting to big changes we will list users detailed info with following command

  • test is our user name for this operation
  • 1001 is the current id of our test user.

Change User Name

We will change username with the following command by providing new username.

  • usermod is command we issue to chage
  • -l test2 is the new username
  • test is the original username

Change User ID

We can change user id too like below.

  • usermod is command used too
  • -u 1010 is new user id provided for the user
  • test2 is the user whose id will be changed.

Check It Again

And we check out user database again for user test.

  • test2 is new username but home directory stays the same
  • 1010 is the users new id

LEARN MORE  How To Install Skype In Linux?

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)