Results 1 to 8 of 8

Thread: [SOLVED] changing user account name

  1. #1
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    [SOLVED] changing user account name

    Is it possible to change the username of the main user account? If not, how do I create a new account with the same sudo privs. as the main account (so i can delete the other account)?

  2. #2
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: changing user account name

    As you use an account, the username insidiously becomes entwined in the paths and contents of many config files. Changing your account name is possible, but it becomes a horrendous mess. I think it is much better to create a new user and then copy data over.
    Config files have to be redone or copied with care.

    To create a new user:
    Code:
    sudo useradd -D NEWUSER
    for group in `groups`; do echo $group; sudo gpasswd -a NEWUSER $group; done
    The first command creates NEWUSER with default settings. The second command makes NEWUSER a member of all the groups you currently are a member of.

  3. #3
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: changing user account name

    I just tried creating a new user with "sudo useradd -D username" and its printing out the useradd help info to stderr. The help information says that this is the correct syntax

    Usage: useradd [options] LOGIN

    Options:
    ...

  4. #4
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: changing user account name

    Sorry, my mistake. Try
    Code:
    sudo useradd --create-home NEWUSER

  5. #5
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: changing user account name

    That seemed to work for adding the user and the groups, but it created the default shell as /bin/sh. How do i set this to /bin/bash?

  6. #6
    Join Date
    Sep 2007
    Beans
    112
    Distro
    Ubuntu Studio 10.04 Lucid Lynx

    Re: changing user account name

    Go to System>Administration>Users and Groups...
    Then edit it from there...
    You may need to unlock it ... just type the password and you're all set...
    Procrastination is the art of keeping up with yesterday.

  7. #7
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: changing user account name

    Quote Originally Posted by benhur99ph View Post
    Go to System>Administration>Users and Groups...
    Then edit it from there...
    You may need to unlock it ... just type the password and you're all set...
    I'm running Ubuntu Server. I don't have the GUI preferences.

  8. #8
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: changing user account name

    Found the solution in 'chsh'. Thanks for the help on this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •