17

When installing Ubuntu it asked me for a name. I entered it as name (space) lastname. Now when I get to login screen, it greets me by that name. I want to change it, in fact to remove last name.

mchid
  • 44,904
  • 8
  • 102
  • 162
dakky
  • 171

2 Answers2

15

Click on the ubuntu button, search for "User" until the User Accounts application shows up, then launch it. Click on the lock button on the top right, this enables you to change your settings.

Then click on your username to change it, and that's it!

enter image description here

This changes the display name the system shows you. To change your actual username is a bit more complex:

Jorge Castro
  • 73,717
12

From the terminal;

sudo chfn -f "FirstName LastName" *username*

where the FirstName Lastname is replaced by the desired names

You can then verify with;

getent passwd $USER | cut -d ':' -f 5 | cut -d ',' -f 1

OR

finger -m $USER | head -n 1 | sed 's/\(.*\)Name\:\s\(.*\)$/\2/g'

Install finger if no previously installed with;

sudo apt install finger