0

when I installed Ubuntu 14.04 I missed some thing on my user name , how to correct it and display it correctly in the terminal.

thanks for help .

5

2 Answers 2

1

Do following from root or user with sudo rights:

sudo usermod -l new_username current_username

sudo mv /home/current_username /home/new_username

sudo usermod -d /home/new_username new_username

And optional, but not sufficient (I think usermod should change only login name, but not your UID)

sudo chown -R new_username /home/new_username

I believe it will be enough for changing user name. Please note, never do that from current user name!!! Log in as root or another user with sudo rights.

See good article on Arch Linux wiki (applicable to all common Linux distros)

https://wiki.archlinux.org/index.php/Change_username

2
  • ask me if you have any problems Jul 5, 2015 at 20:22
  • After a fresh install this is not needed. My solution will work fine.
    – Pilot6
    Jul 5, 2015 at 20:27
0

You can not edit user name.

You can create another user with correct name with administrative privileges. Then login with new user account and remove the incorrect user.

It can be done from System Settings -> User Accounts application.

5
  • 1
    That's not true. User login, home, group can be simply changed if user have access to root or user account with root rights. Jul 5, 2015 at 20:20
  • @user3417815 I know. But it is not straight forward to change user name and home directory, etc for a newbie.
    – Pilot6
    Jul 5, 2015 at 20:21
  • maybe, but we can post simple set of command for this and let know user what is possible to do in any way (gui and cli) Jul 5, 2015 at 20:23
  • 1
    @user3417815 I marked it as duplicate. There is a ready answer.
    – Pilot6
    Jul 5, 2015 at 20:23
  • yeah, so common question. of course user should search before ask something. Jul 5, 2015 at 20:25

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