• Root/
  • Linux/
  • Accounts
  • Helpful commands

    Creation

    Groups

    Group membership is evaluated at session (for example, desktop, ssh or bash) start. This necessitates start of new session to observe change of effective groups.

    Access control

    Root user can log in even as blocked user using su - user

    Recovery

    Account recovery is simple as long as access to local admin account access is available; it's matter of executing sudo passwd account_name Account recovery in case of no access to local admin account access:

    1. Prepare Linux USB installation disk
    2. Restart device and choose to boot from USB device as you would if you'd be installing Linux
    3. Once live media starts and offers you to Try or Install system, press CTRL+ALT+F2 to enter TTY2
    4. Determine root disk of existing installation. Following might assist in process: sudo lsblk
    5. If root partition is part of LVM, scan for it and activate it. Use actual Volume Group device name instead of /dev/ubuntu-vg sudo pvscan sudo vgchange -ay /dev/ubuntu-vg
    6. Create temporary root mount directory mkdir root_mount
    7. Mount existing installation root partition device sudo mount /dev/sda2 root_mount
    8. Change active root directory to mounted root partition sudo chroot root_mount
    9. Change password of account. You will not be prompted for existing root password as installation environment have none: sudo passwd account_name
    10. Restart and remove installation media

    Last update: 2024-08-10