Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

How do I change my logname?For e.g: xyz@ubuntu in the terminal how do I change xyz? I have tried this command

usermod -l *newname* -d /home/*newname* -m *oldname*

but that gave me an error user xyz is currently used by process PID

Command line solutions are appreciated.

share|improve this question

marked as duplicate by Aditya, Luis Alvarado Dec 9 '13 at 0:40

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.

    
You cannot create a user with the same name as an existing user - you can list the all of current users with cat /etc/passwd. –  Wilf Dec 8 '13 at 15:04
    
you want to remove the "hostname". Ex. braiam@braiam-pc becomes braiam? –  Braiam Dec 8 '13 at 15:08
    
user wants to change xyz in xyz@ubuntu, @Braiam. It might also be simpler to create a new user with useradd <newname>, and move the user home directory with mv /home/<oldname> /home/<newname>, though it might not work due to user specific files. –  Wilf Dec 8 '13 at 15:10

1 Answer 1

up vote 0 down vote accepted

You need to not be logged in as the user whose name you are trying to change, while running the usermod command to change the user name. You will have to log out, log in as a different user (such as root), and run the command without your standard user being logged in.

share|improve this answer

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