XY: I installed bazzite and goofed up. The username is wrong and my home is /home/bazzite instead of /home/ludrol

I am trying to run usermod -l ludrol bazzite in tty3 with sudo su - but the bazzite user is logged.

Solution:
Added password to root with passwd
Logged in as root
Ran required usermod commands
Disabled root with passwd -l

  • deadbeef79000@lemmy.nz
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 days ago

    An alternative, if you have console access, to doing that root password dance, is:

    1. Drop to rescue/emergency/single-user mode.
    2. Do your changes to the user account
    3. Drop back to multiuser mode.
  • gnuhaut@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    IDK if this will work but maybe doing exec sudo -i does the trick.

    Otherwise just enable the root account and log in as root. Should be passwd -u root to unlock (passwd -l root to relock), also need to set the root password using passwd root.

    • LainTrain@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 days ago

      Another way to do this is sudo su -c 'this is my command

      E.g. change a fan setting on a ThinkPad with:

      sudo su -c 'echo "level full-speed" > /proc/acpi/ibm/fan'

      So to run a shell you could do all sorts of tricks like:

      sudo su -c '/bin/bash -i' and such.

      Never know when it comes in handy.

  • Sakura VanGogh@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    Create a new user with sudo access then log in as that user and make the change. When done delete the temp user.