change login name

Smoot Carl-Mitchell smoot at tic.com
Fri Jun 20 21:02:21 UTC 2008


On Fri, 2008-06-20 at 10:22 -0400, Jeremy Huntwork wrote:

> 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.

Do not forget to change things which depend on the username, if you are
using those facilities.

e.g /var/mail/<username>, /var/spool/cron/<username>.
-- 
Smoot Carl-Mitchell
System/Network Architect
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list