0

I accidentally disabled my user account. I've changed the administrator password and when I reboot, the log in "user 1" comes up and when I type in my password it won't let me log in. It says that my account is disabled and I should contact my system administrator.

1 Answers1

0

You'll have to use some sort of recovery media, like Parted Magic or a Gentoo Disk. The recovery disk should be x86 or x64 based on your type of system. The Gentoo Handbook has excellent documentation for doing this, and I've used this procedure several times to restore Linux users locked out of various systems. One note: if user1 has an encrypted home directory, and you have not printed the recovery passphrase, your files will NOT be accessible. However, you can guess the password as many times as you like. If you need the command, I will share. Used it just last week to recover a computer that had been missing for three years.

Code Listing 6.1 in https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap4 gives you an idea for how to mount your disks.

This will give you a listing of sdX (typically sda, but sometimes sdb, sdc, or sdd)

sudo fdisk -l /dev/sdX

You can also use file to determine a filesystem type

sudo file -Ls /dev/sdXY

where X is a letter: a, b, c, etc... and Y is a number: 1, 2, 3, 5, 6, etc...

Once you get your drives mounted off of /mnt/gentoo (or whereever) Loosely follow the chroot procedure (Section 6a). You don't need to worry about the mirrorselect stuff, just the mount -o bind etc... stuff from here: https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap5 and the chroot/source stuff (you can use the . shortcut for source, BTW).

Mounting stuff (as root) Assuming / linux partition on sda1:

# Mount root (/) file system
# If your /usr or /home is on another partition, you'll have to mount those also!
# Adjust -t file system type as needed.
mount -t ext4 -o rw /dev/sda1 /mnt/gentoo
# mount -t ext4 -o rw /dev/sda5 /mnt/gentoo/home

# Mount critical file system stuff
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev

# chroot into your old drive
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"

After the chroot, reset the root password

passwd

and the account password

passwd user1

and write the changes to disk and reboot

sync && sync && sync
reboot

You should now be able to use User1.

edit: forgot the rule about linking, pulling stuff in from Gentoo in case they go offline.

The Dude
  • 404
  • 2
  • 7