Results 1 to 4 of 4

Thread: Change username.

  1. #1
    Join Date
    Mar 2012
    Beans
    142

    Change username.

    Hi, I have a question about changing username to new one. Home directory is encrypted and there is only one user of the system. How to do it best? Should I use menu==>system==>users and groups (remove existing user and creating a new one) or using usermod command?
    Code:
    [~]$ usermod -c "current_name" -l new_name old_name
    After change username, everything will work? I mean login, home directory encrypted etc. Frankly, I do not want to create a new user. Username change could(?) affects many parts of the system e.g. /etc/group and /etc/passwd files, path to the user directory in /home/user etc. What about encrypted home directory? After change username this directory still will be encrypted? No files will be deleted? Also password will not be changed? I'm sorry for such naive and really stupid question, but I don't know how to change username correctly. Thanks.
    Last edited by kleenex; February 15th, 2013 at 03:09 PM.

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Change username.

    The user name is not really meant to be changed. Instead you should make a new user. You are aware of potential risks. Why do you want to change it? And do you intend to change the password too?

    Your encrypted home directory won't unfold with a new password. This is a security property because it is easy to change the password for someone with physical access to the computer or drive. I don't know the effect of changing user name, but I would not try without a very good backup of all your personal files and settings (in the home directory).

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Change username.

    @sudodus Wait, what's the problem with changing the user name if the UID stays the same? AFAIK, nothing in the system uses the username directly.

    Update.
    Obviously, you'll need to rename your home directory, /var/mail/username, /var/spool/cron/crontabs/username, etc. Look at the output of
    Code:
    sudo find ~ /var -name '*username*'
    Last edited by schragge; March 4th, 2013 at 10:40 PM.

  4. #4
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Change username.

    usermode will give you a GUI to change name and password in xubuntu in the settings maannger
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

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
  •