Changed username - sudo no longer works - TUXEDO Computers

  ATTENTION: To use our store you have to activate JavaScript and deactivate script blockers!  
Thank you for your understanding!

Changed username
sudo no longer works

TUXEDO OS uses two functions, PolicyKit and sudo, to give administrative rights to programs or commands started by users, for example to change system settings or edit configuration files. When invoking a command such as sudo apt update, sudo checks whether the user is listed in the sudo group. If yes, the command is invoked. If not, an error message is displayed.

In rare cases, your user may no longer be listed in the sudo group, making it impossible for you to perform administrative tasks or execute commands with root privileges. This happens, for example, if you change the name of your user account manually, but disregard the group memberships.

Overview

User management

If there is another user with administrative rights on the system, this problem can be easily corrected: Log in as this user and open the System Settings. Under Users then check that the Account type of the desired user is set to Administrator.

Recovery mode

Restart

If you do not have this option, you must activate the recovery mode of TUXEDO OS. To do this, restart your computer and press the ESC key or Shift key directly after the boot logo with the TUXEDO lettering. On newer computers, it is probably the ESC key. On some TUXEDO devices, you have to time it perfectly. If you miss the window, reboot and try again.

Then in the boot menu select Advanced options for TUXEDO OS GNU/Linux and TUXEDO OS GNU/Linux, with Linux VERSION-tuxedo (recovery mode). In the menu you navigate with the arrow keys up and down. Press the Enter to confirm the selection. If you want to cancel the process completely, press CTRL+ALT+DEL for a restart.

Tip: If you find it difficult to get the timing right to open the Grub boot manager, you can help yourself as follows: Immediately after rebooting, first press F7 to open the boot menu (on some devices also DEL). Then confirm the default selection with Enter. Immediately after that press ESC once to get into the boot manager.

Root access

In the recovery menu, use the arrow keys again to select the item root - Switch to root command line (shell) and confirm the action with Enter. Confirm the subsequent prompt again with Enter. After this step a command prompt opens.

Write permissions

To make changes to the system, you now need write access to the root partition. The following command remounts the root partition with the appropriate permissions.

mount -o rw,remount /

Group membership

Now enter your new username (this must already exist, of course) as a member of the sudo group – adjust the placeholder USERNAME in the following commands accordingly. The command should confirm the success of the action. Afterward, check whether your user is now really included in the admin group, here 27(sudo).

adduser USERNAME sudo
(out)Adding user `USERNAME' to group `sudo' ...
(out)Adding user USERNAME to group sudo
(out)Done.
id USERNAME
(out)uid=1000(USERNAME) gid=1000(USERNAME) Gruppen=1000(USERNAME),4(adm),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),101(systemd-journal),110(kvm),117(bluetooth),121(netdev),124(lpadmin),132(vboxusers)

Restart

With exit you return to the recovery menu and then load the graphical user interface of TUXEDO OS with resume - continue startup process normally. Please note: The startup process does not load all drivers in this case. If the system does not load correctly, restart the computer completely. This completes all the necessary steps, and you can perform all administrative tasks with your user account again.