change login name
Jeremy Huntwork
jhuntwork at lightcubesolutions.com
Fri Jun 20 14:22:57 UTC 2008
On Jun 20, 2008, at 9:12 AM, Derek Broughton wrote:
> Donny George wrote:
>
>> i wanted to chnage the login name of my system
>>
> It's not for the faint of heart. You need to (a) create a new user
> with the
> same uid! AND home directory; (b) make sure the new user has all the
> same
> group memberships (that might be automatic); (c) rename the home
> directory;
> (d) change the home directory assigned to the new user.
Here's how I did it:
1. Open up Terminal and type in 'sudo -i'. Type in your password at
the prompt.
2. Type 'passwd' and then a new password for the root user and confirm
it at the prompts.
3. Log out
4. Hit 'Ctrl+Alt+F1' to take you to a TTY terminal
5. Login as root with your new password for root.
6. mv -v /home/{olduser,newuser}
7. sed -i 's/olduser/newuser/g' /etc/{passwd,group,shadow}
8. Exit the login, hit Alt+F7 to go back to X and login as the new
user name but with the same password as before. Of course, if you
wanted to change the password too, you could leave out the shadow part
in number 7 and then as root type 'passwd newuser' before exiting.
Jeremy Huntwork
LightCube Solutions, LLC
www.lightcubesolutions.com
More information about the ubuntu-users
mailing list