mojave – Terminal locked indefinitely on sudo

I am on the latest version of Mojave 10.14.4 (18E226), Darwin 18.5.0 on a Mac Pro 2012. The system has become totally unusable for all sudo commands. He gets stuck indefinitely every time I shoot a sudo. In addition, remote screen sharing has also stopped working. It worked well before the reboot. I even disabled the firewall after rebooting, but the remote screen sharing still does not work. SSH works well.

I came across this bug under Mac OS 10.12.4 on several forums. Most of the solutions involve modifying the sudoers file, but that involves running a sudo command and "wait", but I waited for hours without success!

Not sure if it's connected, but I've recently removed administrator privileges for a user (in System Preferences> Users & Groups). The system requested a reboot for the changes to take effect. I restarted and this bug came into play.