0

Changed user name in CLI. But even after rebooting,user name is the same in GUI. Why it didn't get changed..? Shall we try to change in GUI mode itself? The users are common to both CLI and GUI right?

2
  • 2
    Which method did you use to change the username?
    – Wilf
    Sep 27, 2015 at 12:01
  • @Wilf : I used 'usermod -l newuser olduser'
    – kiran bbnl
    Oct 3, 2015 at 6:41

1 Answer 1

2

You sort of have two usernames - a username that is usable in SSH, TTYs etc, and the full-name that shows on the login screen - you should be able to see this in your relevant line in /etc/passwd - for example:

wilff:x:1001:1001:Random:/home/wilff:/bin/bash

So in my above case, my username for logging in via SSH/TTY etc is wilff (this is also used for the name of the home directory), whereas my full-name is currently Random.

To change the full-name

You can change the full-name via this command:

sudo chfn -f <NEW-FULL-NAME> <username>

or this one:

sudo usermod -c <NEW-FULL-NAME> <username>

Where <NEW-FULL-NAME>is the new full-name and <username> is the

So, for example again - command:

sudo usermod -c Magic wilff

resulting line in /etc/passwd:

wilff:x:1001:1001:Magic:/home/wilff:/bin/bash

This should also be possible via the User Settings in most Desktop Environments.

To change your username

Guessing this is the bit you have already done

See this question.

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