4

This question already has an answer here:

When I connect to Linux 18 I get this name@server-Belkin ~> How can I remove "name"? and change it to other name

marked as duplicate by karel, wjandrea, guiverc, Pilot6, Parto Oct 5 at 8:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    The format is username@hostname:current-working-directory, so that is probably the username you chose. – user535733 Oct 3 at 15:46
  • yeah a now but i want change the username – john Oct 3 at 15:49
  • 1
    Change the username everywhere? Or just change the prompt string in terminal? – user535733 Oct 3 at 15:52
  • 2
    i wante to change name everywhere , i find to change hostname but i don t find how to change user name – john Oct 3 at 16:01
  • @john Ubuntu, or Lubuntu? Please click edit and remove the tag if it's Ubuntu; if it's really Lubuntu you are using, please update the subject line accordingly. – K7AAY Oct 3 at 17:46
7

COMPUTER NAME CHANGE

First, run sudo hostnamectl | grep hostname and confirm that's the name of the PC you want to change.

Next, run sudo hostnamectl set-hostname whatever where whatever is the name you wish to use henceforth.

Confirm the change was effective with sudo hostnamectl | grep hostname to see the change was effective.

When I check the man page for hostnamectl, I can't see if it require elevated priveleges, so you may be able to do it without the sudo.

USER NAME CHANGE

Set the "root" account password with sudo passwd root then log out with exit and log in using the "root" account and the password you just set.

Change the username and the home folder to the new name that you want with usermod -l <newname> -d /home/<newname> -m <oldname>

Return the root account to its usual unreachability with passwd -l root then logout with exit.

Login with your new username.

Not the answer you're looking for? Browse other questions tagged or ask your own question.