Java Mailing List Archive

http://www.redhatconfig.com/

Home » Ubuntu Technical Support »

Re: change login name

NoOp

2008-06-20

Replies: Find Java Web Hosting

Author LoginPost Reply
On 06/20/2008 02:02 PM, Smoot Carl-Mitchell wrote:
> 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>.

I found this helpful (including the comments):

http://www.cyberciti.biz/faq/howto-change-rename-user-name-id/

I had to do this just as few days ago while setting up a system. I had
set it up to use don and found out the user uses donny. I left the home
directory as don, but changed the rest to donny. Given that it is a new
install there wasn't much in the way of apps that depended too heavily
on 'don' vs 'donny'.

I did not try:

killall -u old
id old
usermod -l new old
groupmod -n new old
usermod -d /home/new -m new
usermod -c “New Real Name” new
id new

but suppose I still could as I'm still messing around with the system &
don't have to deliver it until sometime next week.



--
ubuntu-users mailing list
ubuntu-users@(protected)
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.