I am given an old Ubuntu working system and the previous user had everything on his name so started turning it to my name as typing his name everywhere was bugging me. I tried:
$ usermod -l hussain darhamidThis turned the darhamid@darhamid:$ into hussain@darhamid:$
But I want hussain@darhamid:$ also changed to hussain@hussain. What should I do?
I am using ubuntu 12.04
13 Answers
You have to change the computers hostname as well.
Edit the hostname file and replace the name
gksudo gedit /etc/hostnamealso change the name in hosts
gksudo gedit /etc/hostsLeave the other stuff there untouched.
For the username, it would be cleaner if you deleted the old user and created your new one.
4You'll have to edit /etc/hostname and /etc/hosts, and replace the old hostname with the new.
PS: On the second thought, I'd probably just reinstall to get a clean system.
Open a terminal window.
Input the following command and hit Enter: gksudo gedit /etc/hostname
When prompted, enter the administrator password and click the OK button.
The hostname file will open, displaying the current computer name. Replace the current computer name with the desired new name.
Click Save.
Close all open windows and restart your system.
Source: