Page 1 of 1

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

Posted: Sat Sep 15, 2018 3:08 pm
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?

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

Posted: Sun Sep 16, 2018 1:32 pm
by deepakdeshp

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

Posted: Sun Sep 16, 2018 5:03 pm
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...