Change the Login on an Oracle 8 Linux Computer

Pre-requisites:

You must be logged into a different account to change the username for the desired account.

If you don’t already have a separate account to use, create one by running the following at the command prompt:
sudo useradd -l <new_username> -d /home/<new_username>
You must also disable Automatic Login of the account for which you are changing the username and then reboot into a different account from the one for which you are changing the username.

Refer to step 2 below to enable/disable Automatic Login.

Steps:

  1. Go to Settings -> Details -> Users.
    Select the account to modify.
    Click Unlock and enter the current password to enable for editing user information. The top box is the login name – change it to match the new username you used or will use in the usermod command.
  2. Enable Automatic Login. Go to Settings -> Details -> Users.
    Select the account to modify.
    Click Unlock and toggle Automatic Login to ON from OFF.
  3. Execute the following from the command prompt:
    sudo usermod -l <NEW_USERNAME> -d /home/<NEW_USERNAME> -m <OLD_USERNAME>
    Note: For the next step, the NEW_GROUP_NAME should match the NEW_USERNAME and the OLD_GROUP_NAME should match the OLD_USERNAME.

  4. Execute the following from the command prompt:
    sudo groupmod -n <NEW_GROUP_NAME> <OLD_GROUP_NAME

  5. Reboot the computer. When the reboot completes, the pre-existing /home/<OLD_USERNAME> should be: 
    /home/<NEW_USERNAME>.

    Note: For step 6, ensure you are logged in on the account matching the username to that which you changed.

  6. If using VNC, change the username in the following file:
    $HOME/.config/systemd/user/x0vncserver.service