Wednesday, February 18, 2015

Change UserName on ubuntu

To rename a user

  1. At the start screen press Ctrl+ALT+F1.
  2. Log in using your username and password.
  3. Set a password for the "root" account.
    sudo passwd root
  4. Log out.
    exit
  5. Log in using the "root" account and the password you have previously set.
  6. Change the username and the home folder to the new name that you want.
    usermod -l -d /home/ -m
  7. Change the group name to the new name that you want.
    groupmod -n
  8. Lock the "root" account.
    passwd -l root
  9. If you were using ecryptfs (encrypted home directory). Mount your encrypted directory using ecryptfs-recover-private and edit /.ecryptfs/Private.mnt to reflect your new home directory.
  10. Log out.
    exit
  11. press Ctrl+ALT+F7.

If you get the following error

usermod: can't change /etc/password

run the following commands in the root recovery console

mount -o remount,rw /
 
Then Rerun the usermod command
 
 
 

 

No comments:

Post a Comment