Rename Your Ubuntu Linux username

Consider the renaming the ubuntu linux user name there is no obvious method to do that. General solution for this add new user using new user name and delete the old user account. But imagine your current account can not be changed due to your data and other customized stuff. Then you have to think another way. That's the real life.
I have primary method for that. you can edit some file rename that.

First you have to login root or other account. This can not be done in same account.

Then you have to edit /etc/passwd, /etc/group, /etc/shadow files.

you can do that using following,

# sed -i 's/oldname/newname/g' /etc/passwd
# sed -i 's/oldname/newname/g' /etc/group
# sed -i 's/oldname/newname/g' /etc/shadow

Then simply rename the folder in side the HOME folder to your new user name
/home/oldname => /home/newname

Then relogin..

If you want to rename your Host Name then you must edit /etc/hostname file.

Then relogin...


Arosha Uduwerella.

Comments

Post a Comment

Popular posts from this blog

OpenCv & Visual Studio 2005 Library Paths

Mobile Phones