I have succeded to block admin account. How to restore it?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
vavolop

I have succeded to block admin account. How to restore it?

Post by vavolop »

It happened on Mint Sylvia 18.3. All was done using standard window tools (without command line).

First I created a new user account named "User". Then I registered under the User account and entered again the utility for user management. There I saw that damn button which was something like "Disable account". This way the admin account was disabled. But when I try to enable the account again it says that I don't have enough permission to do this operation. Funny, but I need to restore it somehow. :D Maybe command line can help?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: I have succeded to block admin account. How to restore it?

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: I have succeded to block admin account. How to restore it?

Post by rene »

A bit more specific than above suggestion:

A "Disable account" button I haven't found but indeed you can simply delete the last Administrator account. Before you do "User" is upon opening "Users and Groups" asked for the password for the standard Administrator account; after you do, for the root password -- which Mint 18+ doesn't have by default, putting you in somewhat of a bind indeed.

1. Give yourself (i.e., "User") a password: from a terminal, passwd.
2. User is not a valid UNIX user; find out what "User" is known as UNIX-sides with whoami. I will assume it is "user" without the capital U.
3. Reboot into the GRUB menu; on a BIOS-system you press and hold Left-Shift at the right time, on UEFI you hit Esc at such time.
4. Pick (one of) the "rescue mode" entries from the "Advanced options" submenu.
5. This boots you into a T(ext-mode) UI with "Drop to root shell prompt" as one of its options; take it.
6. Once dropped, remount the root partition read-write with mount -o remount,rw /.
7. Make "user" an Administrator user with adduser user sudo.
8. exit and find yourself back at the TUI; pick "Resume normal boot"
9. Login graphically as User and find yourself capable of administering stuff again.

You can at this point put back your old Administrator user and, once done, demote User again, or... well, anything. Note, seeing as how it seems you can only have deleted rather than disabled the original administrator account this will likely mean you deleted its home directory alongside. That is, don't expect it to still be there...
Locked

Return to “Other topics”