0

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.

Braiam
  • 67,791
  • 32
  • 179
  • 269
user
  • 3
  • 3
  • 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 08 '13 at 15:04
  • you want to remove the "hostname". Ex. braiam@braiam-pc becomes braiam? – Braiam Dec 08 '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 08 '13 at 15:10

1 Answers1

0

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.

dobey
  • 40,982